A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2007-December/075562.html below:

[Python-Dev] PATCH: attribute lookup caching for 2.6

[Python-Dev] PATCH: attribute lookup caching for 2.6 [Python-Dev] PATCH: attribute lookup caching for 2.6Neil Toronto ntoronto at cs.byu.edu
Wed Dec 5 22:24:21 CET 2007
So Jim and PJE finally convinced me to do it the right way. :) Thanks 
guys - it turned out very nice.

http://bugs.python.org/issue1560

http://spreadsheets.google.com/ccc?key=pHIJrYc_pnIUpTm6QSG2gZg&hl=en_US

It caches type/metatype attribute lookups, including missing attributes. 
Summary of the bug tracker issue:

- Successful attribute lookups are 20% faster, even for classes with 
short MROs and (probably most) builtins - haven't tested unsuccessful 
lookups

- Successful hasattr is 5-10% faster, unsuccessful is 5% faster (less 
impressive than above, and likely due to overhead - internally, all 
lookups are the same)

- list.__init__ and list().__init__ are slower, and I can't figure out 
why (creating instances of subclasses of list will be a little slower, 
and this may show up in other builtin types)

- I haven't benchmarked type attribute sets (how much do we care?) - it 
should be quite a bit faster than updating a slot, though

- Caching missing attributes is crucial for good performance

- The CreateNewInstances benchmark uncovered an issue that needs fixing; 
please see the tracker for details

All kinds of commentary and feedback is most welcome.

Neil
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4