Issue 26301: ceval.c: reintroduce fast-path for list[index] in BINARY_SUBSCR
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) * ![]() |
Date: 2016-02-06 01:40 | |
Copy of msg222985 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) * ![]() |
Date: 2016-02-06 01:47 | |
I think this is a duplicate of http://bugs.python.org/issue26280... |
|||
| msg259710 - (view) | Author: STINNER Victor (vstinner) * ![]() |
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) * ![]() |
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_request9223 |
| 2016-02-06 02:26:07 | vstinner | set | status: open -> closed superseder: ceval: Optimize list[int] (subscript) operation similarly to CPython 2.7 resolution: duplicate messages: + msg259716 |
| 2016-02-06 01:49:19 | vstinner | set | files: - binary_subscr.patch |
| 2016-02-06 01:49:13 | vstinner | set | files:
+ binary_subscr-2.patch messages: + msg259710 |
| 2016-02-06 01:47:29 | yselivanov | set | messages: + msg259709 |
| 2016-02-06 01:43:55 | vstinner | set | files:
+ binary_subscr.patch keywords: + patch |
| 2016-02-06 01:40:39 | vstinner | create | |
