4 ms·
The whole book looks very full of interesting low level techniques. Do high level JIT compilers like the V8 or JVM apply vectorisation or any of the other optim
by udbhavs 5y ago
The whole book looks very full of interesting low level techniques. Do high level JIT compilers like the V8 or JVM apply vectorisation or any of the other optimisations mentioned there, or is that level of fine-tuned performance only possible if you code them manually in C++?
- sereja 5y agoAuthor here. I wrote a separate section trying to answer this question: https://en.algorithmica.org/hpc/complexity/languages/ https://en.algorithmica.org/hpc/complexity/languages/ tl;dr: to some extent, but mostly no
- marcos100 5y agoHey author. This looks like a very approachable book given the subject. Still on chapter 2, but really enjoying it. Instant buy for me. Thanks for your effort.
- khoobid_shoma 5y agoI think topics are nicely explained in C and assembly but not C++.
- saagarjha 5y agoMost JITs have basic autovectorization support, but it's generally not that good.
- tralarpa 5y agoPeople claim that the JVM is able to auto-vectorize simple loops: https://stackoverflow.com/questions/59725341/java-auto-vectorization-example https://stackoverflow.com/questions/59725341/java-auto-vecto... That said, I tried the matrix-multiplication example from section 1.2 on different computers and with different jdk version, but I didn't manage to convince the JVM JIT to emit SIMD instructions. No idea whether the loop is too complex for the JIT or whether there is some secret JVM option that I'm not aware of.
- sereja 5y agoIt is not technically legal to use SIMD on most floating-point loops, including the inner product in matrix multiplication, because rounding errors are not commutative. C compilers don't vectorize such loops either unless you pass the -ffast-math flag. I'm sure the JIT compiler of JVM has a similar option. (read the article I linked below, it's all explained there)