Python Profiling
First- I don't expect this proposal to get much traction since it isn't a wizzbang user-facing feature, but I'd remind everyone that plenty of wizzbang features are written in Python and anything that helps us create those will benefit the rest of the community as well.
PROFILING! yes, something beyond "timeit" and "time.time() - start_time" to see where all of the slowdown is coming from. Anyone who has done any kind of serious development understands the need for robust instrumentation, so why are addon developers relying on print statements and third party modules like cprofile, which do work (in much the same way prints or traces work) but do not give a holistic view of what is going on in the context of the addon/script being run in Blender, and have no way of profiling things like GPU usage, etc?
mozilla has this: profiler.firefox.com/docs/
unity's script profiler is fantastic, and includes GPU usage: docs.unity3d.com/Manual/ProfilerCPU.html
chrome's profiler is another great example: developers.google.com/web/tools/chrome-devtools/rendering-tools
Think about it- some of the best tools you've ever used have been made with the programming equivalent of banging rocks together: HardOps, BoxCutter, MeshMachin3, etc. Imagine what addon developers could create with proper instrumentation!
2 Comments
what you might like to try is cProfile.runctx() in combination with runsnakerun GUI. If you wrap your code that calls all the functions in a top level function, and call it from this, it'll return analytics about every fuctions stats, and you can then load it into runsnakerun for a graphical representation.
youtube.com/watch
YES! I'm currently struggling to track down some slow code. This would be a godsend. Maybe as a VScode extension.