Nicholas Pisarro created THRIFT-2307:
----------------------------------------
Summary: Optimization of __eq__ with genslots
Key: THRIFT-2307
URL: https://issues.apache.org/jira/browse/THRIFT-2307
Project: Thrift
Issue Type: Improvement
Components: Python - Compiler
Reporter: Nicholas Pisarro
Priority: Minor
With genslots but not gendynamic, the generated __eq__ function iterates over
__slots__ to get the attribute names and calls getattr() to get the attribute
values of the objects(). However, getattr() is relatively slow.
Given that we already know all member names at the point of making the
generated classes we can generate an __eq__ that looks up all attributes
directly and doesn't need to use getattr() or to loop over __slots__
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)