3 ms·
> * How the code is executed on modern hardware and operating systems. Does anyone know this at this point? With pipelining, out of order execution, vectorisat
by kqr 9y ago
> * How the code is executed on modern hardware and operating systems.
Does anyone know this at this point? With pipelining, out of order execution, vectorisation, register renaming, speculative execution, buffered micro-op fusing and what have you, it's very hard to say general things about how the code executes on the actual hardware.
- yjftsjthsd-h 9y agoPerhaps, "Understand the model of how code pretends to be executed"? Pipelining, etc. are meant to produce the same results as the older/simpler systems. You need to understand that that's not quite reality anymore, but as a basic model it's fine.
- kqr 9y agoSure, but at that point you are content with learning "the x86 virtual machine" -- and is that fundamentally different from being content with learning "the Java virtual machine"? I'm arguing that it's a matter of degree, not of kind. People make it seem like it's the latter.
- barrkel 9y agoIt's different in kind. The JVM completely abstracts away things like class loading from the perspective of bytecode - that stuff seems to happen like magic. Ditto exception handling, stack frame linkage, memory allocation, etc. Viewing all of code and data living together in a big array is important, I think. You don't understand e.g. dynamically generated thunks and shims without seeing the duality of code and data at the execution level.
- vvanders 9y agoShort answer: because cache misses are 10x more common and dominate the time saved from pretty much all of those features. Get your cache misses in order(which is easy to understand in the C model) and you're ahead of 95% of the curve(plus you get a 10-50x performance bump as a reward).
- InclinedPlane 9y agoOf course not. With the meltdown/spectre vulnerabilities and mitigations we see that how a processor/OS/program stack executes code can change from year to year or month to month, with significant performance differences. Maybe that's an exceptional blip, maybe it's a portent for the future.