Where Does CPython Spend Its Time? #411
ericsnowcurrently
started this conversation in
General
Replies: 1 comment 1 reply
-
Maybe https://github.com/benfred/py-spy can help here? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
(This is an offshoot of #410.)
It would be helpful to have a good idea of where CPython spends its time, both generally and on a per-workload basis. First it's worth identifying high-level categories and then it's worth finding out how much time we spend in each (and even what is actually executing in each case, including the call chains).
Here's a first stab at the high-level categories:
PyRun_AnyFileFlags()
, etc. call)(Another avenue to possibly investigate is the incidence rate of the transition between any two of those categories.)
Once we have categories, we'd want to assign all exported functions to one category, and all internal functions to one (or more) exported function. That way we can map function-keyed data onto categories.
So...how do we get there? Profiling! (That can be tracing or sampling or both.)
Here are some profiling results that may help us:
We can probably also get close-enough results for those with some form of static analysis.
Also see #143, #127, #144, #151, and #136.
Beta Was this translation helpful? Give feedback.
All reactions