New submission from Stefan Behnel:

The method lookup fast path in _PyType_Lookup() does not apply during type 
creation, which is highly dominated by the performance of the dict lookups 
along the mro chain. Pre-calculating the name hash speeds up the creation of an 
empty class (i.e. "class Test: pass") by around 20%.

Will send a pull request shortly.

----------
components: Interpreter Core
messages: 301213
nosy: scoder
priority: normal
severity: normal
status: open
title: Speed up _PyType_Lookup() for class creation
type: performance
versions: Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue31336>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to