Skip to content
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

Performance regression with cyclic GC vs 3.13 #129210

Open
nascheme opened this issue Jan 23, 2025 · 2 comments
Open

Performance regression with cyclic GC vs 3.13 #129210

nascheme opened this issue Jan 23, 2025 · 2 comments
Labels
performance Performance or resource usage type-bug An unexpected behavior, bug, or error

Comments

@nascheme
Copy link
Member

nascheme commented Jan 23, 2025

Bug report

Bug description:

While working on the free-threaded GC, I noticed this performance regression with the default build GC. Running the attached script (bm_gc_collect.py) with the main branch of Python shows much worse performance vs 3.13. I get 20.8 seconds for the main branch and 3.3 seconds for 3.13. Adding gc.disable() before calling benchmark_collection() seems to fix it.

bm_gc_collect.py.txt

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

@nascheme nascheme added performance Performance or resource usage type-bug An unexpected behavior, bug, or error labels Jan 23, 2025
@markshannon
Copy link
Member

With a default build (.configure -C) I get the following:

Version Fastest of 10
3.13 3.9s
Main 4.7s

Definitely slower, but not the dramatic slowdown you are seeing.

@nascheme
Copy link
Member Author

Try removing the gc.disable() line on the first line inside benchmark_collection(). That makes "main" a lot slower for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance or resource usage type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants