This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2015年05月24日 13:11 by serhiy.storchaka, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| property_cached_args.patch | serhiy.storchaka, 2015年05月24日 13:11 | review | ||
| Messages (5) | |||
|---|---|---|---|
| msg243980 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2015年05月24日 13:11 | |
Property descriptor getter uses cached tuple for args (issue23910). This can cause problems when called function use args after reading other property or save args. For now I know only one example - clru_cache_3.patch in issue14373. Proposed patch use cached tuple in more robust manner. |
|||
| msg243983 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2015年05月24日 13:30 | |
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 loop
|
|||
| msg243992 - (view) | Author: Raymond Hettinger (rhettinger) * (Python committer) | Date: 2015年05月24日 16:53 | |
LGTM, go ahead and apply. |
|||
| msg243993 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2015年05月24日 17:15 | |
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.
|
|||
| msg243998 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2015年05月24日 18:38 | |
New changeset 5dbf3d932a59 by Serhiy Storchaka in branch 'default': Issue #24276: Fixed optimization of property descriptor getter. https://hg.python.org/cpython/rev/5dbf3d932a59 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:17 | admin | set | github: 68464 |
| 2015年05月24日 20:32:03 | serhiy.storchaka | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2015年05月24日 18:38:44 | python-dev | set | messages: + msg243998 |
| 2015年05月24日 17:15:39 | serhiy.storchaka | set | messages: + msg243993 |
| 2015年05月24日 16:53:30 | rhettinger | set | assignee: serhiy.storchaka messages: + msg243992 |
| 2015年05月24日 13:30:32 | serhiy.storchaka | set | messages: + msg243983 |
| 2015年05月24日 13:26:30 | serhiy.storchaka | link | issue14373 dependencies |
| 2015年05月24日 13:11:49 | serhiy.storchaka | create | |