Repository navigation
Correct reuse argument tuple in property descriptor #68464
Copy link
Copy link
Closed
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
Description
Activity
- addedinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
on May 24, 2015 Affect on performance:
$ ./python -m timeit -r 11 -s "from collections import namedtuple as n;a = n('n', 'a b c')(1, 2, 3)"Unpatched: 10000000 loops, best of 11: 0.0567 usec per loop
Patched : 10000000 loops, best of 11: 0.0567 usec per loopLGTM, go ahead and apply.
Sorry, it was incorrect microbenchmark. Correct is:
$ ./python -m timeit -r 11 -s "from collections import namedtuple as n;a = n('n', 'a b c')(1, 2, 3)" -- "a.a" 3.4 : 1000000 loops, best of 11: 0.601 usec per loop 3.5 unpatched: 1000000 loops, best of 11: 0.445 usec per loop 3.5 patched : 1000000 loops, best of 11: 0.454 usec per loop
There is small slowdown (2%), but it is only small part of the gain of the optimization.
New changeset 5dbf3d932a59 by Serhiy Storchaka in branch 'default':
Issue bpo-24276: Fixed optimization of property descriptor getter.
https://hg.python.org/cpython/rev/5dbf3d932a59
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields: