-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagePerformance or resource usagetype-featureA feature request or enhancementA feature request or enhancement
Description
Feature or enhancement
Proposal:
I tried many things to speed listobject.c's binarysort()
, but nothing really helped (neither code tweaks nor entirely different approaches).
However, I got annoyed enough at the ancient code to rewrite it 😉 Some specific annoyances:
-
When sortslices were introduced, this was left with a slightly weird signature, mixing a semi-abstract sortslice argument with raw pointers into the key part.
-
My aging eyes can often no longer see the difference between "l" and "1".
-
While it's still idiomatic C to do pointer arithmetic "by hand", the code is clearer when written in
a[index]
style. At least for simple code like this, modern optimizing compilers should produce much the same machine instructions either way.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagePerformance or resource usagetype-featureA feature request or enhancementA feature request or enhancement