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

[Feature Request] Merge profile sessions from multiple runs to get statistical numbers like Average/p95/mean #345

Open
teddybearxzh opened this issue Oct 8, 2024 · 1 comment

Comments

@teddybearxzh
Copy link

Hi,

Firstly I want to thank you for having this tool and I have benefited a lot from it to optimize our codebase!

A feature that has been in my mind for some time: since in real case, different modules in code may have different time variances and to get more accurate profiling results, we need to run multiple times and look at average/mean/p95 numbers for further optimization.

Currently I don't see an option to do that in pyinstrument and it would be best if it can support merging multiple profile sessions from multiple runs to get statistical numbers like Average/p95/Mean.

Thank you!

@joerick
Copy link
Owner

joerick commented Oct 9, 2024

There is Session.combine in the Python API. But that's just summing the times. I can't quite see how statistics would work generally, because strictly speaking we don't actually know how long a function took, just that we saw X amount of it in the samples taken. So statistics like p95 could be pretty misleading I fear.

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