Issue 26301: ceval.c: reintroduce fast-path for list[index] in BINARY_SUBSCR (original) (raw)

Issue26301

Created on 2016-02-06 01:40 by vstinner, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
binary_subscr-2.patch vstinner,2016-02-06 01:49
Pull Requests
URL Status Linked Edit
PR 9853 closed pablogsal,2018-10-13 19:47
Messages (4)
msg259708 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-02-06 01:40
Copy of by Raymond Hettinger from issue #21955: "There also used to be a fast path for binary subscriptions with integer indexes. I would like to see that performance regression fixed if it can be done cleanly."
msg259709 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2016-02-06 01:47
I think this is a duplicate of http://bugs.python.org/issue26280...
msg259710 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-02-06 01:49
(Oops, I attached the wrong patch, fixed in patch v2.) Quick & dirty micro-benchmark: Original: $ ./python -m timeit -s 'lst=list("hello")' 'lst[2]' 10000000 loops, best of 3: 0.0261 usec per loop Patched: $ ./python -m timeit -s 'lst=list("hello")' 'lst[2]' 10000000 loops, best of 3: 0.0186 usec per loop
msg259716 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-02-06 02:26
> I think this is a duplicate of http://bugs.python.org/issue26280... Oh, I missed this one. I didn't understand "[]" in the title. I didn't understand the purpose of optimizing BUILD_LIST :-D
History
Date User Action Args
2022-04-11 14:58:27 admin set github: 70489
2018-10-13 19:47:51 pablogsal set pull_requests: + <pull%5Frequest9223>
2016-02-06 02:26:07 vstinner set status: open -> closedsuperseder: ceval: Optimize list[int] (subscript) operation similarly to CPython 2.7resolution: duplicatemessages: +
2016-02-06 01:49:19 vstinner set files: - binary_subscr.patch
2016-02-06 01:49:13 vstinner set files: + binary_subscr-2.patchmessages: +
2016-02-06 01:47:29 yselivanov set messages: +
2016-02-06 01:43:55 vstinner set files: + binary_subscr.patchkeywords: + patch
2016-02-06 01:40:39 vstinner create