[Python-Dev] Speeding up CPython 5-10% (original) (raw)
Yury Selivanov yselivanov.ml at gmail.com
Wed Jan 27 17:40:26 EST 2016
- Previous message (by thread): [Python-Dev] Speeding up CPython 5-10%
- Next message (by thread): [Python-Dev] Speeding up CPython 5-10%
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
BTW, this optimization also makes some old optimization tricks obsolete.
No need to write 'def func(len=len)'. Globals lookups will be fast.
No need to save bound methods:
obj = [] obj_append = obj.append for _ in range(10**6): obj_append(something)
This hand-optimized code would only be marginally faster, because of LOAD_METHOD and how it's cached.
Yury
- Previous message (by thread): [Python-Dev] Speeding up CPython 5-10%
- Next message (by thread): [Python-Dev] Speeding up CPython 5-10%
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]