Noseyparker - 19 June

I tried 2 Python libraries to profile to find performance hotspots and the time taken to run key functions in my code - the cProfile and profilehooks libraries.

Both libraries produced timing results for functions, however they didn't present timings for the key functions. I looked online for clues but unfortunately couldn't find any. The parent classes for these methods are 4 levels deep in inheritance, and I suspect the profiler can't trace code this deep.

I'll keep trying settings, as well as some basic timing code. The decorator timing code technique (option 1) looks like a neat solution I'll try. See link: http://www.marinamele.com/7-tips-to-time-python-scripts-and-control-memory-and-cpu-usage

I'd like to make my GitHub repository public soon. Unfortunately in early commits I hard coded personal information which I want to remove first. I'll work out which commits I need to squash together to remove this - I do plan to keep a private repository copy with all of these commits.

Comments

If this were C code, I would

If this were C code, I would suspect inlining, but I'm not sure if the Python compiler does that. You might want to check.

It's OK to just drop/squash all of those early commits rather than do something more fine-grained. I think a single rebase should do the trick.