[issue1568] PATCH: Armin's attribute lookup caching for 3.0

Neil Toronto report at bugs.python.org
Wed Jan 23 19:12:26 CET 2008


Neil Toronto added the comment:

There's nothing it tests that standard unit tests don't, so it shouldn't
stick around as a unit test. I used it to time different types of
attribute lookups and left it in as an optimization aid.

The main test groups are '.' access, successful hasattr (returns True),
and failing hasattr (returns False). For each group it prints a header
and then four test cases for each test class: metaclass attribute access
(class.__class__), class attribute access (class.__init__), class
attribute access via an instance (class().__class__), and instance
attribute access (class().__init__). The test classes include a few
built-ins and the classes of a made-up deep hierarchy.

The main thing to notice is that, when you run this using the patched
source, every number is no larger than when you run it using the trunk,
and most are smaller.

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1568>
__________________________________


More information about the Python-bugs-list mailing list