Skip to content

Conversation

@pablogsal
Copy link
Member

@pablogsalpablogsal commented Oct 31, 2023

@pablogsal
Copy link
MemberAuthor

From this test:

from time import perf_counter as time from timeit import repeat for e in range(2, 6): n = 10 ** e exec(f'''def f(): if 0 == 1:{'unreached;' * n} try: raise RuntimeError except RuntimeError: pass''') number = 10**6 // n t = min(repeat(f, number=number)) / number print(f'{n:6}{t * 1e6 :7.1f} μs') 

Before:

./python.exe bloch.py 100 1.4 μs 1000 10.5 μs 10000 102.4 μs 100000 1241.8 μs 

After:

./python.exe bloch.py 100 0.7 μs 1000 0.6 μs 10000 0.5 μs 100000 0.5 μs 

@pablogsalpablogsal added needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Oct 31, 2023
… the line number Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
@pablogsalpablogsal enabled auto-merge (squash) October 31, 2023 14:45
@pablogsalpablogsal requested a review from ambvOctober 31, 2023 14:50
@pablogsalpablogsal merged commit abb1542 into python:mainOct 31, 2023
@pablogsalpablogsal deleted the gh-109181 branch October 31, 2023 15:02
@miss-islington-app
Copy link

Thanks @pablogsal for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry, @pablogsal, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker abb15420c11d9dda9c89f74eac8417240b321109 3.12 

@miss-islington-app
Copy link

Sorry, @pablogsal, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker abb15420c11d9dda9c89f74eac8417240b321109 3.11 

@bedevere-app
Copy link

GH-111550 is a backport of this pull request to the 3.11 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.11 only security fixes label Oct 31, 2023
pablogsal added a commit to pablogsal/cpython that referenced this pull request Oct 31, 2023
…compute the line number (pythonGH-111548) Signed-off-by: Pablo Galindo <pablogsal@gmail.com>. (cherry picked from commit abb1542) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
@bedevere-app
Copy link

GH-111551 is a backport of this pull request to the 3.12 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.12 only security fixes label Oct 31, 2023
pablogsal added a commit to pablogsal/cpython that referenced this pull request Oct 31, 2023
…compute the line number (pythonGH-111548) Signed-off-by: Pablo Galindo <pablogsal@gmail.com>. (cherry picked from commit abb1542) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
pablogsal added a commit to pablogsal/cpython that referenced this pull request Oct 31, 2023
…compute the line number (pythonGH-111548) Signed-off-by: Pablo Galindo <pablogsal@gmail.com>. (cherry picked from commit abb1542) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com> Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
pablogsal added a commit to pablogsal/cpython that referenced this pull request Oct 31, 2023
…compute the line number (pythonGH-111548) Signed-off-by: Pablo Galindo <pablogsal@gmail.com>. (cherry picked from commit abb1542) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com> Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
pablogsal added a commit that referenced this pull request Oct 31, 2023
pablogsal added a commit to pablogsal/cpython that referenced this pull request Oct 31, 2023
pablogsal added a commit that referenced this pull request Oct 31, 2023
FullteaR pushed a commit to FullteaR/cpython that referenced this pull request Nov 3, 2023
… the line number (python#111548) Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
… the line number (python#111548) Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
… the line number (python#111548) Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@pablogsal