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

Is there a way to measure time spent in GC? #791

Closed
sarahec opened this issue Mar 9, 2024 · 3 comments
Closed

Is there a way to measure time spent in GC? #791

sarahec opened this issue Mar 9, 2024 · 3 comments

Comments

@sarahec
Copy link
Contributor

sarahec commented Mar 9, 2024

I'm benchmarking and performance tuning some ML code, and garbage collection seems to be the largest drag on performance. Is there a way to measure time spent in GC?

@emeryberger
Copy link
Member

Not within Scalene. My intuition for GC in Python is that it's not usually a problem because most of the time I'd expect reference counting to handle most of the garbage (except for cycles, which I wouldn't expect in a case where you are using an ML library). I'd be interested to see what's going on! Anyway, looks like py-spy might be helpful here: see benfred/py-spy#389.

@sarahec
Copy link
Contributor Author

sarahec commented Mar 10, 2024

Thank you :) I'll keep looking.

@sarahec sarahec closed this as completed Mar 10, 2024
@emeryberger
Copy link
Member

Might try this, though it's not exactly the nicest UI:

https://stackoverflow.com/a/6115258/335756

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants