Newstylization of twisted
[email protected] Sat, 27 Feb 2010 01:33:28 -0000
| Newsgroups | gmane.comp.python.twisted.bugs |
|---|---|
| Message-ID | <[email protected]> |
New submission from fijal <None>:
Twisted in places has old style classes. In places they're simply old style classes, in other places they have been hacked over, having a mixture of old and new style in mro. This is particularly unfriendly for !PyPy (old style classes being unfriendly, but less so) and prevents Py3k conversion (a bit less of my concern).
Here are some benchmarks on names.py from https://code.launchpad.net/~exarkun/+junk/twisted-benchmarks (run at revision 14). For reference, on this machine CPython scores almost equally 11000 req/sec. Tests were run in chunks of 5 for 5s each (names.py -n 5 -d 5).
!PyPy with JIT:
{{{
7978 names/sec (39890 names in 5 seconds)
13720 names/sec (68600 names in 5 seconds)
14412 names/sec (72060 names in 5 seconds)
14178 names/sec (70890 names in 5 seconds)
14616 names/sec (73080 names in 5 seconds)
}}}
twisted.internet.protocol.!AbstractDatagramProtocol being new-style class
{{{
8684 names/sec (43420 names in 5 seconds)
14704 names/sec (73520 names in 5 seconds)
14978 names/sec (74890 names in 5 seconds)
15000 names/sec (75000 names in 5 seconds)
15122 names/sec (75610 names in 5 seconds)
}}}
the same as above plus all base classes of twisted.internet.udp.Port becoming newstyle classes (twisted.persisted.styles.Ephemeral and twisted.python.log.Logger).
{{{
9250 names/sec (46250 names in 5 seconds)
15840 names/sec (79200 names in 5 seconds)
16328 names/sec (81640 names in 5 seconds)
16544 names/sec (82720 names in 5 seconds)
16302 names/sec (81510 names in 5 seconds)
}}}
The latter change is probably slightly more controversial, since some of those classes are exported, but I don't know how crucial that is.
----------
Type : enhancement
Component: core
Keywords :
Priority : normal
Nosy :
----------
http://twistedmatrix.com/trac/ticket/4324