I have tried the new JavaVM on Win, that optionally performs escape analysis, and the results are nice:
Timings, N=100_000_000, Windows, seconds: D 1: 40.20 DMD D 2: 21.83 DMD D 2: 18.80 DMD, struct + scope C++: 18.06 D 1: 8.47 DMD D 2: 7.41 DMD + scope Java: 1.84 V.1.6.0_14, -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC Java 1.78 -server Java: 1.44 Java: 1.38 V.1.6.0_14 Java: 0.28 V.1.6.0_14, -server -XX:+DoEscapeAnalysis Timings, N=100_000_000, Pubuntu, seconds: D 1: 25.7 LDC C++: 6.87 D 1: 2.67 LDC + scope Java: 1.49 Bye, bearophile