Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 19, 2022

Conversation

corona10
Copy link
Member

@corona10 corona10 commented Apr 19, 2022

import pyperf

runner = pyperf.Runner()
runner.timeit(name="bench bisect",
              stmt="""
bisect.insort(a, 30)
""",
              setup = """

import bisect

class A(list):
    pass

a = 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
Member Author

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 corona10 force-pushed the gh-90699-bisect-modulestate branch from 9f8ca1d to a31c571 Compare April 19, 2022 09:40
@corona10 corona10 force-pushed the gh-90699-bisect-modulestate branch from 9e63803 to 2f21b9e Compare April 19, 2022 12:22
@corona10 corona10 requested a review from erlend-aasland April 19, 2022 12:28
@corona10 corona10 requested a review from erlend-aasland April 19, 2022 12:43
@corona10 corona10 merged commit 16fc573 into python:main Apr 19, 2022
@corona10 corona10 deleted the gh-90699-bisect-modulestate branch April 19, 2022 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants