2 ms·
This is true if you can always be calculating. You can't. For instance, CPUs have sped up a lot compared to memory. As a result, if you just calculate as fast
by lordnacho 10y ago
This is true if you can always be calculating.
You can't.
For instance, CPUs have sped up a lot compared to memory. As a result, if you just calculate as fast as you can, you run out of data to calculate on. Suddenly it becomes more relevant how fast you can access memory. So now we have all sorts of complicated cache mechanisms to help us keep the data to hand. Coding needs to be cache friendly as well.
If you look at CPU prices, you can see the amount of cache increases with the price.
- userbinator 10y agoAlso important to keep in mind is that the "data" also includes instructions --- and running out of instructions to execute is even worse than data; with things like OoO and superscalar, the CPU can still keep going with executing "around" instructions that are waiting for data, but only as long as it can continue fetching instructions.