3 ms·
One of the things that struck me recently is that working out what a computer is actually spending it's time doing is now almost a Master's thesis to do properl
by mhh__ 5y ago
One of the things that struck me recently is that working out what a computer is actually spending it's time doing is now almost a Master's thesis to do properly.
- adrianN 5y agoDepending on the level of analysis you can even get a PhD. See for example https://core.ac.uk/download/pdf/18462805.pdf https://core.ac.uk/download/pdf/18462805.pdf
- mhh__ 5y agoNot surprising at all, sadly.
- bayindirh 5y agoI've found it the hard way when I was trying to profile my own code. If you're using a few optimized libraries and designed your code for high-speed parallel execution, the compiled thing becomes almost impossible to trace in a practical manner.
- rwmj 5y agoDidn't perf work? What difficulties did you encounter?
- bayindirh 5y agoUsed perf record for getting CPU efficiency numbers, and it worked very well, however to be able to reliably trace the code, I had to compile it in debug mode with no optimizations, and run with a single thread. That combination increased the execution time considerably. Some of the Matrix and solver code coming from Eigen is heavily optimized for SIMD operations and using it with -O0 is just painful. Moreover, I had to verify its memory sanity and used Valgrind for that. Using a full size problem meant it had to churn for days to finish execution. Having deadlines doesn't always help in this stuff.
- mhh__ 5y agoI found perf pretty crummy compared to vTune and even vTune is not fantastic at scale.
- bayindirh 5y agoI think perf and valgrind is a fantastic combination. While valgrind has a big overhead, it can make a lot of things visible without instrumenting the code. I also think Perf is phenomenal for its scope. It's showing performance metrics of the code without any processor dependency and instrumentation.
- Bayart 5y agoOn the positive side of things, the notion that performance is multivarious and means different things to different contexts has really sunk in with the general tech demographic and we don't see much of the "one big number that sums it all" type of stuff. Think the GHz race or FPS measuring contests.
- roflc0ptic 5y agoBoth with the GHz race and FPS measuring contests, we've gotten to the point where there's substantially diminishing returns - GHz has stopped growing in the same way, and reaching the limits of human perception with FPS is generally readily achievable, and so it loses interest as a contest. I suspect your broader point stands - certainly "performance is multivarious and means different things in different contexts" has sunk in for me. But I suspect the actual difficulty of reasoning about performance deters most people from doing it beyond big O notation. The fact that I'm aware that performance is complicated doesn't drive me to understand the complexity, I mostly just say "good enough" and move on.
- nitrogen 5y agoreaching the limits of human perception with FPS Nothing can hit 200fps at 4K, which you'd need to reach low enough latencies to be imperceptible.