В Птн, 17/10/2008 в 18:29 +0200, Esteve Fernandez пишет:
> Hi all. Is there a reason why Thrift Python classes are not new style by 
> default? I want to contribute a patch which adds a __slots__ variable to all 
> autogenerated classes, but it would break old style classes.

David Reiss wrote in discussion:
"""
We measured a significant slowdown with new-style classes, even
when using slots.
"""

http://mail-archives.apache.org/mod_mbox/incubator-thrift-dev/200807.mbox/[EMAIL
 PROTECTED]

I've tested serialization with common parent (i.e. structure gets write
and read method form the parent) and I've seen slowdown about 10% (but I
didn't use __slots__).

I'll repeat the benchmark tomorrow with slots to see if it gives some
speed up.

> New style classes were introduced in Python 2.2 and I think Thrift only 
> supports 2.4 and onwards, so I think it wouldn't be much of a hassle to drop 
> support for old style classes.
> 
> Cheers.
> 
> PS: sorry if you receive this e-mail twice, I sent another copy hours ago and 
> didn't show up

Reply via email to