4 ms·
Another quick check I've used is to take a function I suspect might need optimization and make it slower, and see how that affects run-time. If it hardly affect
by magicalhippo 7y ago
Another quick check I've used is to take a function I suspect might need optimization and make it slower, and see how that affects run-time. If it hardly affects the run-time it's probably not worth spending time on.
Not perfect by any means but usually a nice check to verify optimization potential.
- jaybosamiya 7y agoI haven't had a chance to mess around with it much, but the coz-profiler [1] uses basically the same idea, but the other way around (i.e., slow down everything else to get a "virtual speedup") which helps quantify what the effect of optimizing some code would be. I learnt about this tool from Emery Berger's talk [2] on this (at strangeloop), which I highly recommend. Lots of really nice insight, even outside of this tool. [1] https://github.com/plasma-umass/coz https://github.com/plasma-umass/coz [2] https://www.youtube.com/watch?v=r-TLSBdHe1A https://www.youtube.com/watch?v=r-TLSBdHe1A
- sitkack 7y agoCame to say the same thing, this Berger talk is phenomenal. I have watched it twice, planning on at least a third.