You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add way to apply profiling to an entire class (or file) #21
line_profiler has been is super useful for me, but it can be a bit tedious to add the decorator on every function in a code path to profile. It seems like it would be possible to support applying the decorator to a class wrapping every class method, which would be nice syntax.
I think it'd also be interesting to support doing so to every function declared in entire file or project/entrypoint, but I'm less sure what the right syntax for that is.
i had the same thoughts, i didnt want to decorate every single function manually and wanted to wrap a class so i came up with an admittedly hacky way of doing it and decided i might aswell share it with everyone else because i really enjoy line_profiler
im not sure if the devs will approve of the hacky method (hopefully it might give them an idea for a better solution?) so i thought id let you know about the commit incase you wanted to grab it yourself #24#23#22 are the PRs i submitted. ive merged those PRs into a fork https://github.com/ta946/line_profiler temporarily until the devs integrate a solution, i do not plan to keep it up to date
the command line arguments and how to use them are described in #24
Activity
ta946 commentedon Jun 12, 2020
i had the same thoughts, i didnt want to decorate every single function manually and wanted to wrap a class so i came up with an admittedly hacky way of doing it and decided i might aswell share it with everyone else because i really enjoy line_profiler
im not sure if the devs will approve of the hacky method (hopefully it might give them an idea for a better solution?) so i thought id let you know about the commit incase you wanted to grab it yourself
#24 #23 #22 are the PRs i submitted. ive merged those PRs into a fork https://github.com/ta946/line_profiler temporarily until the devs integrate a solution, i do not plan to keep it up to date
the command line arguments and how to use them are described in #24