3 ms·
Optimizations can be fun, but all bets are off when next generation of hardware comes out, and a thousand man-hours spent on compiler/optimizer. And most perfor
by z3t4 7y ago
Optimizations can be fun, but all bets are off when next generation of hardware comes out, and a thousand man-hours spent on compiler/optimizer. And most performance increases the last decade have come from multi-process/threading, while single core execution have actually become slower. I think in the future it will be increasingly more important for algorithms to work in parallel, so the performance can scale with the number of CPU/cores or Moore's law.
- tempguy9999 7y agoI don't agree. > but all bets are off when next generation of hardware comes out the sentinel trick reduces the number of checks, so should be independent of hardware. > and a thousand man-hours spent on compiler/optimizer I can't see a conventional compiler ever automatically doing the sentinel trick as it relies on knowing at least 1. whether multithreading will be happening 2. the size of the array, as the trick's likely increasingly pointless as it outgrows the cache, and possibly other stuff I can't think of. I might also disagree on making things parallel - cache aware code can bring significant speedups on single threads so that first, then parallise. disclaimer: I'm not Knuth/Terje Mathisen/Hennesy or Patterson.