Chapel VS Java benchmarks

Current benchmark data was generated on Fri Sep 30 2022, 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 766ms 12ms 414.2MB 733ms 123ms openjdk 20
java 2.java 785ms 6.1ms 409.0MB 753ms 127ms openjdk 19
java 2.java 804ms 24ms 683.4MB 853ms 203ms graal/jvm 17.0.4
java 2.java 1479ms 49ms 1081.8MB 1013ms 687ms openjdk/zgc 19
chapel 4.chpl 2546ms 7.4ms 50.3MB 2507ms 20ms chpl 1.28.0
chapel 3.chpl 2663ms 18ms 41.5MB 2623ms 13ms chpl 1.28.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 2.java 179ms 6.1ms 109.2MB 173ms 30ms openjdk 19
java 2.java 185ms 15ms 110.9MB 183ms 27ms openjdk 20
java 2.java 210ms 21ms 165.1MB 253ms 43ms graal/jvm 17.0.4
chapel 3.chpl 235ms 1.7ms 11.3MB 223ms 0ms chpl 1.28.0
chapel 4.chpl 237ms 1.6ms 13.1MB 230ms 0ms chpl 1.28.0
java 2.java 345ms 11ms 240.4MB 183ms 193ms 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 3298ms 52ms 201.3MB 6173ms 120ms openjdk 19
chapel 1-m.chpl 3955ms 51ms 55.6MB 7720ms 33ms chpl 1.28.0
java 1-m.java 4199ms 57ms 944.9MB 7373ms 620ms openjdk/zgc 19
java 1.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 20

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1-m.chpl 277ms 4.4ms 26.2MB 500ms 10ms chpl 1.28.0
java 1-m.java 715ms 68ms 112.9MB 1240ms 53ms openjdk 19
java 1-m.java 816ms 116ms 107.2MB 1427ms 53ms openjdk 20
java 1-m.java 977ms 78ms 302.2MB 1567ms 190ms openjdk/zgc 19

edigits

Input: 250001

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1.chpl 90ms 0.6ms 18.4MB 73ms 7ms chpl 1.28.0
java 1-m.java 817ms 50ms 281.2MB 1387ms 120ms graal/jvm 17.0.4
java 1-m.java 822ms 47ms 207.2MB 1430ms 70ms openjdk 19
java 1-m.java 823ms 67ms 221.6MB 1443ms 67ms openjdk 20
java 1-m.java 1036ms 18ms 422.0MB 1453ms 337ms openjdk/zgc 19

Input: 100000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1.chpl 40ms 0.6ms 16.9MB 27ms 3ms chpl 1.28.0
java 1-m.java 420ms 13ms 189.2MB 647ms 90ms graal/jvm 17.0.4
java 1-m.java 445ms 7.5ms 116.4MB 717ms 50ms openjdk 19
java 1-m.java 451ms 8.9ms 119.1MB 730ms 53ms openjdk 20
java 1-m.java 565ms 25ms 208.9MB 750ms 180ms openjdk/zgc 19

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 5-m.chpl 133ms 2.6ms 16.1MB 220ms 0ms chpl 1.28.0
java 4.java 466ms 12ms 41.7MB 540ms 17ms openjdk 19
java 4.java 470ms 6.4ms 43.9MB 547ms 13ms openjdk 20
java 4.java 526ms 14ms 43.5MB 547ms 70ms openjdk/zgc 19
java 4-m.java 549ms 6.3ms 118.4MB 850ms 47ms graal/jvm 17.0.4

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 5.chpl 26ms 1.0ms 16.1MB 23ms 0ms chpl 1.28.0
java 4.java 142ms 2.0ms 41.3MB 160ms 10ms openjdk 19
java 4.java 142ms 1.7ms 42.9MB 157ms 20ms openjdk 20
java 4.java 156ms 7.9ms 82.9MB 173ms 37ms graal/jvm 17.0.4
java 4.java 201ms 3.0ms 41.3MB 170ms 63ms openjdk/zgc 19

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1.chpl 15ms 2.3ms 16.4MB 0ms 10ms chpl 1.28.0
java 1.java 77ms 2.0ms 58.0MB 70ms 14ms graal/jvm 17.0.4
java 1.java 83ms 3.5ms 40.6MB 80ms 10ms openjdk 20
java 1.java 89ms 4.9ms 40.5MB 78ms 10ms openjdk 19
java 1.java 136ms 2.5ms 39.9MB 80ms 68ms 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 976ms 4.2ms 72.3MB 1780ms 40ms chpl 1.28.0
java 3-m.java 1499ms 3.9ms 116.2MB 2733ms 37ms openjdk 19
java 3-m.java 1513ms 13ms 114.9MB 2747ms 47ms openjdk 20
java 3-m.java 1537ms 13ms 192.2MB 2767ms 93ms graal/jvm 17.0.4
java 3-m.java 2015ms 5.0ms 174.5MB 3473ms 177ms openjdk/zgc 19

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 3-m.chpl 176ms 6.7ms 59.6MB 260ms 27ms chpl 1.28.0
java 3-m.java 429ms 5.9ms 92.9MB 690ms 33ms openjdk 20
java 3-m.java 503ms 8.8ms 94.1MB 727ms 100ms openjdk/zgc 19
java 3-m.java 508ms 64ms 96.7MB 820ms 50ms openjdk 19
java 3-m.java 739ms 144ms 179.8MB 1260ms 90ms graal/jvm 17.0.4

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 2.chpl 401ms 1.1ms 16.4MB 390ms 0ms chpl 1.28.0
java 1.java 586ms 6.5ms 87.4MB 627ms 30ms graal/jvm 17.0.4
java 1.java 638ms 5.0ms 44.2MB 647ms 20ms openjdk 19
java 1.java 643ms 3.3ms 42.4MB 650ms 23ms openjdk 20
java 1.java 705ms 4.7ms 42.0MB 663ms 73ms openjdk/zgc 19
java 2.java 2299ms 9.1ms 534.4MB 2290ms 163ms openjdk 20
java 2.java 2309ms 29ms 487.1MB 2310ms 157ms openjdk 19
java 2.java 3386ms 50ms 1654.7MB 2387ms 1197ms openjdk/zgc 19

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 2.chpl 56ms 1.4ms 16.4MB 43ms 3ms chpl 1.28.0
java 1.java 157ms 3.9ms 42.3MB 170ms 10ms openjdk 19
java 1.java 157ms 4.7ms 42.7MB 170ms 20ms openjdk 20
java 1.java 157ms 3.0ms 87.9MB 203ms 23ms graal/jvm 17.0.4
java 1.java 214ms 4.5ms 43.5MB 183ms 63ms openjdk/zgc 19
java 2.java 480ms 11ms 354.0MB 527ms 93ms openjdk 20
java 2.java 482ms 9.4ms 345.0MB 523ms 103ms openjdk 19
java 2.java 802ms 2.3ms 484.3MB 590ms 367ms openjdk/zgc 19

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 2.chpl 482ms 1.9ms 19.6MB 470ms 0ms chpl 1.28.0
java 1.java timeout 0.0ms 0.0MB 0ms 0ms graal/jvm 17.0.4
java 1.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 19
java 1.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 20
java 1.java timeout 0.0ms 0.0MB 0ms 0ms openjdk/zgc 19

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 2.chpl 126ms 4.1ms 16.9MB 110ms 3ms chpl 1.28.0
java 1.java 1515ms 17ms 317.7MB 1813ms 113ms openjdk 19
java 1.java 1529ms 15ms 309.2MB 1803ms 107ms openjdk 20
java 1.java 1564ms 6.5ms 384.4MB 1910ms 120ms graal/jvm 17.0.4
java 1.java 2102ms 48ms 967.5MB 1730ms 713ms 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 1911ms 10ms 221.6MB 1720ms 177ms chpl 1.28.0
java 3.java timeout 0.0ms 0.0MB 0ms 0ms graal/jvm 17.0.4
java 3.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 19
java 3.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 20
java 3.java timeout 0.0ms 0.0MB 0ms 0ms openjdk/zgc 19

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 3.chpl 201ms 0.8ms 33.7MB 157ms 30ms chpl 1.28.0
java 3.java 1005ms 4.4ms 109.9MB 1327ms 43ms openjdk 19
java 3.java 1009ms 12ms 113.9MB 1327ms 47ms openjdk 20
java 3.java 1023ms 47ms 189.9MB 1433ms 70ms graal/jvm 17.0.4
java 3.java 1145ms 36ms 159.8MB 1283ms 163ms openjdk/zgc 19

secp256k1

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1.chpl 1479ms 2.5ms 32.3MB 1457ms 7ms chpl 1.28.0

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1.chpl 386ms 1.2ms 32.3MB 367ms 3ms chpl 1.28.0

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1-m.chpl 1941ms 3.7ms 32.3MB 3797ms 3ms chpl 1.28.0
chapel 1.chpl 3776ms 0.5ms 32.3MB 3760ms 0ms chpl 1.28.0
java 2-m.java 4360ms 25ms 107.0MB 8363ms 43ms graal/jvm 17.0.4
java 2.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 19
java 2.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 20
java 2.java timeout 0.0ms 0.0MB 0ms 0ms openjdk/zgc 19

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1-m.chpl 507ms 1.4ms 32.3MB 953ms 7ms chpl 1.28.0
chapel 1.chpl 963ms 0.7ms 32.3MB 947ms 7ms chpl 1.28.0
java 2-m.java 1256ms 53ms 103.4MB 2277ms 47ms graal/jvm 17.0.4
java 2-m.java 1633ms 55ms 42.8MB 3080ms 23ms openjdk 20
java 2-m.java 1736ms 112ms 45.0MB 3293ms 10ms openjdk 19
java 2-m.java 1749ms 139ms 42.7MB 3200ms 77ms openjdk/zgc 19

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1-m.chpl 147ms 2.6ms 32.3MB 253ms 0ms chpl 1.28.0
chapel 1.chpl 256ms 0.7ms 32.3MB 243ms 7ms chpl 1.28.0
java 2-m.java 436ms 26ms 100.2MB 727ms 37ms graal/jvm 17.0.4
java 2-m.java 577ms 28ms 44.3MB 1013ms 20ms openjdk 20
java 2-m.java 583ms 8.5ms 43.6MB 1033ms 7ms openjdk 19
java 2-m.java 632ms 24ms 44.2MB 1010ms 77ms openjdk/zgc 19