5 ms·
Life was so simple back in the 1970s, when I began to program. Processor manuals for CPUs had a table of instruction timings, and you could just add up those
by PopePompus 6y ago
Life was so simple back in the 1970s, when I began to program. Processor manuals for CPUs had a table of instruction timings, and you could just add up those times for each instruction and figure out exactly how long a code segment would take to execute. No branch prediction failures, no cache misses, no pipeline quirks...
- iamgopal 6y agothe amount of transistors required to do those extra jobs, couldn't be used for extra core ? Will it be faster or slower ?
- jcranmer 6y agoIt doesn't really work like that. It is ridiculously easy to stamp out ALUs on a die, but the problem is keeping those ALUs fed with useful data. And memory just can't keep up with modern CPU clock speeds. Modern CPUs use cache hierarchies to push off having to access main memory as late as possible, and even then, they use a lot of transistors to deal with the fact that even on-chip caches are slow compared to the ALUs. GPUs instead use those transistors to keep as many threads running as possible, treating a request to go to main memory as an event to switch to another bank of threads while it waits for the memory request to come back.
- lmm 6y agoWe do have processors that use their silicon to implement a bunch of simple, consistent cores that do simple operations; the most common form are GPUs. They can run parallel operations much more efficiently, and theoretically perhaps most or all programs could be implemented in a way that would be more efficient on those processors. But certainly the fastest way that's been found to run existing C-style code is these very complex execution pipelines; extra cores are not the limiting factor for most workloads.
- Scoundreller 6y agoAlso made it really easy to time your glitch attacks against “secure” MCUs ;)
- JoeAltmaier 6y agoYes it seems everything is inside out now. Used to be everything had to be aligned to perform well (or at all). Now, you want to be unaligned in many cases, at least as far as cache lines are concerned, to avoid every malloc returning a block that maps to the same cache lines. And there are so many registers, its often possible to put whole algorithms into registers instead of stack or memory. I wonder if the age of the 'stack' should come to an end?