I like this technique so that I can do ad hock timings as needed in a complicated User Interface in MATLAB.
3 CommentsOldest to Newest
In my experience many Matlab programmers are surprisingly unaware that they can turn profiling on and off at will, interactively or programmatically, while a Matlab program is running. Doing so can significantly improve our profiling and performance-tuning effectiveness.
I don’t normally use dedicated GUI controls, since this “soils” my GUI, and I’d need to update the layout. Instead, I typically just run
profile on; ... profile off; profile report"
from the Command Prompt just before starting the workflow-to-be-analyzed. Simpler still, I click the “Start/Stop profiling” button in the Profiler tool. Another simpler alternative is to create two simple shortcuts in the Desktop that start/stop profiling respectively. This obviates the need to update numerous different GUIs separately.
In a related note, I often use the technique of selective workflow profiling to understand how a customer’s GUI behaves and works. I start profiling, interact with a specific GUI part, and then stop profiling and look at the detailed report to see what the code did in this time. It is then easy to step right into the relevant part and start coding/fixing. Customers are often surprised how quickly I can understand and fix their code, when it’s really just the selective use of the Profiler… Let’s keep this trade secret between us, shall we? :-)
I’m more than happy to discover this page. I want to to thank you for ones time for
this fantastic read!! I definitely savored every bit of it and
I have you saved as a favorite to check out new things
in your web site.
Fabulous, what a weblog it is! This weblog presents valuable facts to us, keep it up.