I use cprofile
to get high offenders, however the filename:lineno
is only listing the filename, but having the filepath listed would be more usefull to quickly open that path. Especially if there might be same module nams in different hierarchies.
ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 3.922 display.py:599 (show)
Is there an option to turn that into fullpath?
I guess you format the output with "pstats.Stats" class and you have:
stats = Stats(profiler)
stats.strip_dirs() # remove this
There doesn't seem to be a built in way but you can do this:
import cProfile
import pstats
p = cProfile.Profile()
s = p.run("1+1")
pstats.Stats(s).sort_stats(2).print_stats()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With