Chapel VS Java benchmarks

Current benchmark data was generated on Mon Feb 06 2023, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][2 cores] Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz (Model 85)

* -m in a file name stands for multi-threading or multi-processing

* -i in a file name stands for direct intrinsics usage. (Usage of simd intrinsics via libraries is not counted)

* -ffi in a file name stands for non-stdlib FFI usage

* (You may find time < time(user) + time(sys) for some non-parallelized programs, the overhead is from GC or JIT compiler, which are allowed to take advantage of multi-cores as that's more close to real-world scenarios.)

binarytrees

Input: 18

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 2.java 741ms 67ms 604.5MB 693ms 140ms openjdk 20
java 2.java 785ms 70ms 601.6MB 723ms 153ms openjdk 19
java 2.java 929ms 77ms 665.9MB 940ms 233ms graal/jvm 17.0.6
java 2.java 1459ms 59ms 1085.7MB 960ms 723ms openjdk/zgc 19
chapel 4.chpl 2503ms 10ms 60.2MB 2460ms 20ms chpl 1.29.0
chapel 3.chpl 2798ms 9.2ms 64.2MB 2760ms 27ms chpl 1.29.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 2.java 187ms 22ms 108.8MB 167ms 37ms openjdk 20
java 2.java 192ms 10ms 111.6MB 187ms 33ms openjdk 19
java 2.java 204ms 15ms 162.8MB 223ms 60ms graal/jvm 17.0.6
chapel 4.chpl 235ms 3.4ms 28.0MB 210ms 7ms chpl 1.29.0
chapel 3.chpl 244ms 1.0ms 24.0MB 227ms 0ms chpl 1.29.0
java 2.java 346ms 6.2ms 239.6MB 207ms 167ms openjdk/zgc 19

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 1-m.java 3410ms 117ms 198.3MB 6373ms 130ms openjdk 19
java 1-m.java 4472ms 132ms 924.9MB 7827ms 667ms openjdk/zgc 19
chapel 1-m.chpl 4744ms 72ms 61.5MB 9257ms 43ms chpl 1.29.0
java 1.java timeout 0.0ms 143.3MB 9577ms 97ms openjdk 20

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1-m.chpl 319ms 15ms 34.1MB 570ms 10ms chpl 1.29.0
java 1-m.java 854ms 61ms 112.8MB 1507ms 50ms openjdk 19
java 1-m.java 907ms 79ms 112.3MB 1597ms 60ms openjdk 20
java 1-m.java 1004ms 94ms 238.1MB 1497ms 207ms openjdk/zgc 19

edigits

Input: 250001

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1.chpl 88ms 3.7ms 7.4MB 73ms 0ms chpl 1.29.0
java 1-m.java 810ms 87ms 202.8MB 1410ms 70ms openjdk 20
java 1-m.java 820ms 13ms 207.6MB 1417ms 63ms openjdk 19
java 1-m.java 878ms 28ms 293.5MB 1490ms 110ms graal/jvm 17.0.6
java 1-m.java 1095ms 65ms 443.9MB 1563ms 350ms openjdk/zgc 19

Input: 100000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1.chpl 42ms 3.1ms 22.8MB 27ms 3ms chpl 1.29.0
java 1-m.java 408ms 21ms 162.0MB 643ms 57ms graal/jvm 17.0.6
java 1-m.java 455ms 22ms 115.7MB 710ms 67ms openjdk 20
java 1-m.java 465ms 10ms 117.2MB 757ms 47ms openjdk 19
java 1-m.java 572ms 10.0ms 208.7MB 770ms 187ms openjdk/zgc 19

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 5-m.chpl 135ms 1.6ms 3.8MB 227ms 3ms chpl 1.29.0
java 4.java 472ms 15ms 40.5MB 540ms 20ms openjdk 20
java 4.java 477ms 7.5ms 43.4MB 550ms 10ms openjdk 19
java 4.java 536ms 5.5ms 41.8MB 547ms 73ms openjdk/zgc 19
java 4.java 555ms 7.5ms 97.9MB 757ms 33ms graal/jvm 17.0.6

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 5.chpl 27ms 3.1ms 14.6MB 27ms 0ms chpl 1.29.0
java 4.java 151ms 4.9ms 40.7MB 160ms 13ms openjdk 19
java 4.java 152ms 14ms 39.8MB 170ms 13ms openjdk 20
java 4.java 159ms 10ms 86.3MB 180ms 30ms graal/jvm 17.0.6
java 4.java 210ms 11ms 41.2MB 170ms 70ms openjdk/zgc 19

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1.chpl 11ms 0.7ms 2.6MB 10ms 0ms chpl 1.29.0
java 1.java 80ms 2.1ms 48.1MB 72ms 14ms graal/jvm 17.0.6
java 1.java 87ms 9.2ms 39.3MB 78ms 16ms openjdk 20
java 1.java 93ms 4.7ms 42.4MB 76ms 24ms openjdk 19
java 1.java 150ms 9.1ms 41.0MB 86ms 64ms openjdk/zgc 19

knucleotide

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 3-m.chpl 1105ms 20ms 80.4MB 2030ms 40ms chpl 1.29.0
java 3-m.java 1420ms 16ms 113.4MB 2567ms 40ms openjdk 20
java 3-m.java 1510ms 5.7ms 115.0MB 2733ms 40ms openjdk 19
java 3-m.java 1680ms 28ms 165.9MB 3040ms 73ms graal/jvm 17.0.6
java 3-m.java 2020ms 14ms 173.9MB 3490ms 163ms openjdk/zgc 19

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 3-m.chpl 187ms 6.2ms 68.8MB 303ms 13ms chpl 1.29.0
java 3-m.java 427ms 3.1ms 88.2MB 693ms 47ms openjdk 20
java 3-m.java 515ms 8.3ms 94.0MB 723ms 117ms openjdk/zgc 19
java 3-m.java 517ms 69ms 94.1MB 863ms 37ms openjdk 19
java 3-m.java 534ms 30ms 136.2MB 877ms 63ms graal/jvm 17.0.6

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 2.chpl 400ms 2.9ms 3.6MB 387ms 0ms chpl 1.29.0
java 1.java 599ms 11ms 89.9MB 623ms 27ms graal/jvm 17.0.6
java 1.java 651ms 5.4ms 40.6MB 660ms 10ms openjdk 20
java 1.java 661ms 11ms 42.0MB 657ms 23ms openjdk 19
java 1.java 707ms 18ms 41.7MB 650ms 70ms openjdk/zgc 19
java 2.java 2110ms 21ms 516.4MB 2083ms 167ms openjdk 20
java 2.java 2163ms 14ms 550.9MB 2123ms 173ms openjdk 19
java 2.java 2913ms 129ms 1417.8MB 2140ms 963ms openjdk/zgc 19

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 2.chpl 59ms 3.3ms 30.2MB 43ms 0ms chpl 1.29.0
java 1.java 160ms 6.0ms 40.5MB 167ms 23ms openjdk 20
java 1.java 163ms 3.2ms 89.9MB 190ms 30ms graal/jvm 17.0.6
java 1.java 178ms 5.1ms 42.0MB 170ms 23ms openjdk 19
java 1.java 217ms 7.7ms 43.8MB 173ms 63ms openjdk/zgc 19
java 2.java 460ms 1.3ms 347.4MB 490ms 107ms openjdk 20
java 2.java 488ms 15ms 362.6MB 517ms 107ms openjdk 19
java 2.java 793ms 2.4ms 487.0MB 563ms 377ms openjdk/zgc 19

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 2.chpl 484ms 2.7ms 15.6MB 467ms 0ms chpl 1.29.0
java 1.java timeout 0.0ms 331.1MB 5447ms 97ms graal/jvm 17.0.6
java 1.java timeout 0.0ms 284.6MB 5387ms 110ms openjdk 19
java 1.java timeout 0.0ms 270.7MB 5410ms 100ms openjdk 20
java 1.java timeout 0.0ms 1375.1MB 4547ms 903ms openjdk/zgc 19

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 2.chpl 126ms 0.8ms 11.0MB 107ms 7ms chpl 1.29.0
java 1.java 1451ms 18ms 261.6MB 1790ms 90ms openjdk 19
java 1.java 1458ms 14ms 295.9MB 1767ms 100ms openjdk 20
java 1.java 1543ms 16ms 342.7MB 1893ms 113ms graal/jvm 17.0.6
java 1.java 2059ms 27ms 987.0MB 1660ms 750ms openjdk/zgc 19

regex-redux

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 3.chpl 1908ms 24ms 221.6MB 1723ms 170ms chpl 1.29.0
java 3.java timeout 0.0ms 251.3MB 5357ms 113ms graal/jvm 17.0.6
java 3.java timeout 0.0ms 206.2MB 5233ms 87ms openjdk 19
java 3.java timeout 0.0ms 204.3MB 5237ms 77ms openjdk 20
java 3.java timeout 0.0ms 339.7MB 4920ms 277ms openjdk/zgc 19

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 3.chpl 207ms 2.8ms 46.9MB 163ms 23ms chpl 1.29.0
java 3-m.java 1022ms 5.4ms 166.2MB 1477ms 57ms graal/jvm 17.0.6
java 3.java 1024ms 24ms 111.9MB 1353ms 50ms openjdk 20
java 3.java 1028ms 9.0ms 109.8MB 1363ms 37ms openjdk 19
java 3.java 1174ms 17ms 157.9MB 1323ms 147ms openjdk/zgc 19

secp256k1

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1.chpl 1487ms 0.9ms 32.3MB 1467ms 7ms chpl 1.29.0

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1.chpl 389ms 3.8ms 32.3MB 370ms 3ms chpl 1.29.0

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1-m.chpl 1998ms 78ms 32.3MB 3857ms 7ms chpl 1.29.0
chapel 1.chpl 3774ms 2.9ms 32.3MB 3747ms 7ms chpl 1.29.0
java 2-m.java 4353ms 35ms 91.0MB 8370ms 40ms graal/jvm 17.0.6
java 2.java timeout 0.0ms 44.0MB 9700ms 27ms openjdk 19
java 2.java timeout 0.0ms 40.6MB 9707ms 23ms openjdk 20
java 2.java timeout 0.0ms 43.9MB 9613ms 57ms openjdk/zgc 19

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1-m.chpl 509ms 1.1ms 32.3MB 963ms 3ms chpl 1.29.0
chapel 1.chpl 961ms 1.5ms 32.3MB 943ms 7ms chpl 1.29.0
java 2-m.java 1256ms 17ms 93.9MB 2293ms 27ms graal/jvm 17.0.6
java 2-m.java 1690ms 21ms 44.1MB 3167ms 20ms openjdk 19
java 2-m.java 1719ms 55ms 42.2MB 3123ms 70ms openjdk/zgc 19
java 2-m.java 1964ms 48ms 40.9MB 3727ms 17ms openjdk 20

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1-m.chpl 146ms 1.8ms 32.3MB 247ms 3ms chpl 1.29.0
chapel 1.chpl 258ms 1.7ms 32.3MB 240ms 7ms chpl 1.29.0
java 2-m.java 443ms 28ms 90.8MB 740ms 30ms graal/jvm 17.0.6
java 2-m.java 583ms 44ms 42.6MB 1013ms 17ms openjdk 19
java 2-m.java 603ms 35ms 40.7MB 1057ms 17ms openjdk 20
java 2-m.java 636ms 27ms 42.1MB 1000ms 70ms openjdk/zgc 19