[Python-Dev] Speeding up CPython 5-10%
Yury Selivanov
yselivanov.ml at gmail.com
Wed Jan 27 17:40:26 EST 2016
More information about the Python-Dev mailing list
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.
1. No need to write 'def func(len=len)'. Globals lookups will be fast.
2. 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 ]
More information about the Python-Dev mailing list