rkern / line_profiler

(OLD REPO) Line-by-line profiling for Python - Current repo ->
https://github.com/pyutils/line_profiler
Other
3.6k stars 254 forks source link

Clarification on instructions #115

Closed petered closed 5 years ago

petered commented 6 years ago

Wasn't immediately obvious how to use this nice tool (had to look into tests to see how it's used). I propose a more complete python example.

caethan commented 5 years ago

N.B. you don't actually have to import and instantiate LineProfiler in your own code to test. That's what the kernprof script is for --- it injects the object into your code as it runs, so the only modification to your own code you need to do is decorate the functions you want to profile.