4 ms·
This is an edge case. Disassembly may not tell the whole story but it is the definitive answer to what the compiler thinks about your code. Given enough knowled
by neonsunset 2y ago
This is an edge case. Disassembly may not tell the whole story but it is the definitive answer to what the compiler thinks about your code. Given enough knowledge it is not difficult to account for cache/memory accesses, see where store-to-load forwarding may or may not kick in, consider optimal independent operations scheduling, check if the code is too branch heavy or not, etc etc.
And once you're done, you can do another round with tools which can do more detailed analysis like https://uica.uops.info https://uica.uops.info
I do this when writing performance-sensitive C# all the time (it's very easy to quickly get compiler disassembly) and it saves me a lot of time.