Does anyone know why Java would be faster here? Is there any kind of optimization happening under the hood? (Automatic memoization?)
See the updated blog again. It seems issue is with Clang/LLVM on MacOSX. I reran the test on Linux with Gnu g++ and it outperforms Java.