Skip to content

gh-90699: Use module state to access insert str object. - #91693

Merged
corona10 merged 4 commits into
python:mainfrom
corona10:gh-90699-bisect-modulestate
Apr 19, 2022
Merged

gh-90699: Use module state to access insert str object.#91693
corona10 merged 4 commits into
python:mainfrom
corona10:gh-90699-bisect-modulestate

Conversation

@corona10

@corona10corona10 commented Apr 19, 2022

Copy link
Copy Markdown
Member
importpyperfrunner=pyperf.Runner()
runner.timeit(name="bench bisect",
stmt="""bisect.insort(a, 30)""",
setup="""import bisectclass A(list): passa = A(range(1000))"""
)

Mean +- std dev: [main] 1.14 us +- 0.01 us -> [module] 1.06 us +- 0.01 us: 1.07x faster

@corona10

Copy link
Copy Markdown
MemberAuthor
Raised RLIMIT_NOFILE: 256 -> 1024
0:00:00 load avg: 5.14 Run tests sequentially
0:00:00 load avg: 5.14 [1/1] test_bisect
beginning 6 repetitions
123456
......
== Tests result: SUCCESS ==
1 test OK.
Total duration: 210 ms
Tests result: SUCCESS

@corona10
corona10force-pushed the gh-90699-bisect-modulestate branch from 9f8ca1d to a31c571CompareApril 19, 2022 09:40
Comment threadModules/_bisectmodule.c
Comment threadModules/_bisectmodule.c
Comment threadModules/_bisectmodule.c Outdated
@corona10
corona10force-pushed the gh-90699-bisect-modulestate branch from 9e63803 to 2f21b9eCompareApril 19, 2022 12:22
Comment threadModules/_bisectmodule.c Outdated
@corona10
corona10 merged commit 16fc573 into python:mainApr 19, 2022
@corona10
corona10 deleted the gh-90699-bisect-modulestate branch April 19, 2022 13:12
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@corona10@erlend-aasland@kumaraditya303@bedevere-bot