3 ms·
So with this level of complexity and opaqueness for a simple routine, does it ever get any better? If your algorithm has ten intertwined loops, does one have
by joe_the_user 15y ago
So with this level of complexity and opaqueness for a simple routine, does it ever get any better?
If your algorithm has ten intertwined loops, does one have any hope of systematically optimizing performance or would you be reduced to "intuition" and easter-egging. (http://www.catb.org/jargon/html/E/Easter-egging.html http://www.catb.org/jargon/html/E/Easter-egging.html)
What about "cache oblivious" algorithms? http://en.wikipedia.org/wiki/Cache-oblivious_algorithm http://en.wikipedia.org/wiki/Cache-oblivious_algorithm
- kenferry 15y agoWhat I would like to see is support in performance tools, like Instruments on Mac/iOS, for understanding and visualizing the effects of memory latency on your code. Sampling tools have been an incredible step forward for understanding why your code takes a long time, but I haven't seen anything remotely easy to use that helps understand memory latency. Considering how much slower our computers are at memory vs everything else, this could make a big difference!
- nitrogen 15y agoHave you tried Valgrind's Cachegrind (http://valgrind.org/docs/manual/cg-manual.html http://valgrind.org/docs/manual/cg-manual.html) and found it inadequate?
- repsilat 15y agoIt's pretty slow. Alternatives that take advantage of hardware counters (like OProfile and Intel VTune) don't get in the way so much. With long-running simulations, or when trying to simulate performance in light of real-world loads you really don't want the VM overhead you get with Valgrind/Cachegrind if you can avoid it.
- minimax 15y agoHave you looked at Shark? It can show you where your program most frequently encounters L2 cache misses (or really any event your cpu has a hardware performance counter to track). Intel VTune and the "perf" tool from the Linux kernel also perform similarly.
- kenferry 15y agoYes, I have. I wouldn't count the raw performance counters as easy to use, though. They're usable by experts familiar with the specific chip being profiled. Getting actual latency as opposed to misses and particularly visualizing it is maybe possible, but compare that to the profiling situation - hit a button, get data anyone can understand.