News for hackers. Stuff that matters.
Re:Integrate Line Profiling with Python Decorator by code4you on Wednesday April 28, 2021 @01:20PM (#26971828)
I don't have much experience with python profiling, but this looks like a really easy way to get granular performance metrics. I could see this being quite useful in longer functions with multiple performance sensitive parts. I'll make sure to keep this profiling technique in mind next time I have to write Python.
Re:Integrate Line Profiling with Python Decorator by leb3 on Wednesday April 28, 2021 @01:52PM (#26972106)
Line profiling like this is a lot easier for me to interpret than flame graphs, and the decorator seems convenient enough to just stick on any function. How does it work if you want to profile multiple functions within a stack?
Re:Integrate Line Profiling with Python Decorator by jhirshman on Wednesday April 28, 2021 @01:04PM (#26971647)
Documentation typically recommends that python profilers be run as modules. Integrating them into the code directly as a 1-line import plus decorator makes it a lot easier to teach new developers to use the profilers.
Re:Integrate Line Profiling with Python Decorator by jbunc on Wednesday April 28, 2021 @01:28PM (#26971916)
Looks like a useful method.