classification
Title: Optimize itemgetter()
Type: performance Stage: resolved
Components: Library (Lib) Versions: Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: rhettinger, serhiy.storchaka
Priority: normal Keywords: patch, patch, patch

Created on 2019-01-05 05:17 by rhettinger, last changed 2019-01-07 16:39 by rhettinger. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 11435 merged rhettinger, 2019-01-05 05:20
PR 11435 merged rhettinger, 2019-01-05 05:20
PR 11435 merged rhettinger, 2019-01-05 05:20
Messages (3)
msg333041 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2019-01-05 05:17
Improve performance by 33% by optimizing argument handling and by adding a fast path for the common case of a single non-negative integer index into a tuple (which is the typical use case in the standard library).
msg333047 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2019-01-05 07:59
Please provide microbenchmark results also for the following cases:

* Negative index with tuple.
* Slice index with tuple.
* Tuple subclass.
* List.
* Large (2**61 and -2**61) index.

I do not expect significant regression, but if it is, we should be aware.

If the above cases are not covered by tests, it may be worth to add them.
msg333175 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2019-01-07 16:38
New changeset 2d53bed79c1953390f85b191c72855e457e09305 by Raymond Hettinger in branch 'master':
bpo-35664: Optimize operator.itemgetter (GH-11435)
https://github.com/python/cpython/commit/2d53bed79c1953390f85b191c72855e457e09305
History
Date User Action Args
2019-01-07 16:39:30rhettingersetkeywords: patch, patch, patch
status: open -> closed
resolution: fixed
stage: patch review -> resolved
2019-01-07 16:38:44rhettingersetmessages: + msg333175
2019-01-05 07:59:41serhiy.storchakasetkeywords: patch, patch, patch
nosy: + serhiy.storchaka
messages: + msg333047

2019-01-05 05:20:40rhettingersetkeywords: + patch
stage: patch review
pull_requests: + pull_request10867
2019-01-05 05:20:38rhettingersetkeywords: + patch
stage: (no value)
pull_requests: + pull_request10866
2019-01-05 05:20:34rhettingersetkeywords: + patch
stage: (no value)
pull_requests: + pull_request10865
2019-01-05 05:17:56rhettingercreate