4 ms·
Now you could try to time it with -fno-tree-vectorize or whatever gcc uses nowadays. You might be surprised again :)
by gdy 8y ago
Now you could try to time it with -fno-tree-vectorize or whatever gcc uses nowadays. You might be surprised again :)
- dragontamer 8y agoYup yup. SIMD is a CPU-level optimization, but the problem (at size 10,000 x 10,000) is DDR4 memory-limited. SIMD only really makes a difference at the L1 or L2 cache levels. Its a fancy micro-optimization that compilers do and can improve code speed in those cases... But the "big" change, going from column-wise traversal into row-wise traversal, is the huge memory optimization that programmers should know about. It just so happens that SIMD-optimizations are also easier for compilers to figure out on row-wise traversal, so you get SIMD-optimization "for free" in many cases.