2 ms·
I think the best way to go about optimization is to maintain a constant baseline level of mechanical sympathy with the computer's architecture. If you burn int
by bob1029 1y ago
I think the best way to go about optimization is to maintain a constant baseline level of mechanical sympathy with the computer's architecture.
If you burn into your soul the table of NUMA latencies and really accept the inevitable conclusions regarding practical computation, a lot of the optimization discussion simply boils down to keeping the closest cache as hot as possible as often as possible. Put differently, if you can get the working set to ~fit in L1, then you have nothing to worry about. The CPU is faster than most people can reason about now. You can talk to L1 1000x before you can talk to the GPU 1x. This stuff makes a ridiculous difference when applied correctly.
Context switching and communication between threads is where most developers begin to lose the rabbit. Very often a problem can be solved on one physical core much faster than if you force it to be solved across many physical cores.