Chapel VS Java benchmarks

Current benchmark data was generated on Thu Dec 26 2024, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][4 cores] AMD EPYC 7763 64-Core Processor (Model 1)

* -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 472ms 8.6ms 637.8MB 543ms 123ms openjdk 23
java 2-m.java 514ms 38ms 645.2MB 707ms 140ms graal/jvm 17.0.8
java 2.java 517ms 31ms 573.2MB 550ms 133ms openjdk 21
java 2.java 1171ms 9.3ms 1048.8MB 573ms 760ms openjdk/zgc 21
chapel 4.chpl 1955ms 3.2ms 66.3MB 1940ms 3ms chpl 1.31.0
chapel 3.chpl 2058ms 12ms 66.3MB 2040ms 7ms chpl 1.31.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 2-m.java 123ms 1.9ms 167.2MB 150ms 37ms openjdk 21
java 2.java 126ms 5.3ms 98.3MB 163ms 20ms openjdk 23
java 2-m.java 150ms 5.9ms 230.3MB 213ms 60ms graal/jvm 17.0.8
chapel 4.chpl 191ms 1.4ms 36.4MB 183ms 3ms chpl 1.31.0
chapel 3.chpl 196ms 2.0ms 36.3MB 190ms 0ms chpl 1.31.0
java 2.java 309ms 2.7ms 243.4MB 163ms 197ms openjdk/zgc 21

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 1-m.java 1820ms 108ms 265.6MB 6813ms 120ms openjdk 21
java 1-m.java 2317ms 164ms 239.6MB 8720ms 137ms openjdk 23
chapel 1-m.chpl 2318ms 44ms 610.0MB 4507ms 70ms chpl 1.31.0
java 1-m.java 2754ms 346ms 1205.4MB 8730ms 1103ms openjdk/zgc 21

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1-m.chpl 209ms 15ms 564.4MB 327ms 53ms chpl 1.31.0
java 1-m.java 421ms 56ms 93.9MB 1347ms 67ms openjdk 23
java 1-m.java 422ms 20ms 115.8MB 1380ms 77ms openjdk 21
java 1-m.java 665ms 19ms 212.5MB 1790ms 253ms openjdk/zgc 21

edigits

Input: 250001

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1.chpl 79ms 1.6ms 36.5MB 67ms 3ms chpl 1.31.0
java 1-m.java 591ms 45ms 266.4MB 1590ms 87ms openjdk 21
java 1-m.java 610ms 5.6ms 359.5MB 1183ms 97ms graal/jvm 17.0.8
java 1-m.java 661ms 23ms 223.2MB 1770ms 70ms openjdk 23
java 1-m.java 976ms 14ms 525.9MB 1697ms 430ms openjdk/zgc 21

Input: 100000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1.chpl 40ms 0.3ms 34.5MB 30ms 0ms chpl 1.31.0
java 1-m.java 315ms 31ms 229.0MB 613ms 73ms graal/jvm 17.0.8
java 1-m.java 358ms 29ms 195.2MB 977ms 50ms openjdk 21
java 1-m.java 375ms 29ms 126.0MB 973ms 60ms openjdk 23
java 1-m.java 502ms 14ms 212.9MB 973ms 217ms openjdk/zgc 21

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 5-m.chpl 113ms 1.3ms 32.4MB 187ms 3ms chpl 1.31.0
java 4.java 443ms 1.8ms 106.0MB 607ms 50ms graal/jvm 17.0.8
java 4.java 451ms 6.8ms 47.5MB 537ms 17ms openjdk 21
java 4.java 460ms 1.9ms 49.1MB 553ms 10ms openjdk 23
java 4.java 573ms 7.3ms 46.9MB 547ms 140ms openjdk/zgc 21

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 5.chpl 28ms 1.1ms 32.4MB 27ms 0ms chpl 1.31.0
java 4.java 121ms 5.7ms 46.6MB 153ms 27ms openjdk 21
java 4-m.java 128ms 0.7ms 96.1MB 177ms 33ms graal/jvm 17.0.8
java 4.java 128ms 3.8ms 48.0MB 173ms 17ms openjdk 23
java 4.java 241ms 0.7ms 45.8MB 163ms 133ms openjdk/zgc 21

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1.chpl 16ms 0.5ms 32.8MB 10ms 0ms chpl 1.31.0
java 1.java 66ms 2.0ms 58.9MB 66ms 22ms graal/jvm 17.0.8
java 1.java 71ms 3.8ms 44.7MB 72ms 14ms openjdk 23
java 1.java 75ms 1.7ms 43.9MB 74ms 22ms openjdk 21
java 1.java 189ms 4.6ms 44.4MB 82ms 134ms openjdk/zgc 21

knucleotide

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 3-m.chpl 759ms 8.4ms 100.9MB 1423ms 3ms chpl 1.31.0
java 3-m.java 1032ms 66ms 127.0MB 3463ms 40ms openjdk 21
java 3-m.java 1078ms 38ms 156.3MB 3653ms 63ms openjdk 23
java 3-m.java 1100ms 30ms 183.1MB 3740ms 67ms graal/jvm 17.0.8
java 3-m.java 1464ms 28ms 179.0MB 4623ms 203ms openjdk/zgc 21

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 3-m.chpl 123ms 2.2ms 93.1MB 207ms 7ms chpl 1.31.0
java 3-m.java 335ms 16ms 101.6MB 977ms 43ms openjdk 21
java 3-m.java 345ms 22ms 138.8MB 897ms 80ms graal/jvm 17.0.8
java 3-m.java 361ms 10.0ms 87.0MB 1053ms 43ms openjdk 23
java 3-m.java 443ms 22ms 100.2MB 943ms 163ms openjdk/zgc 21

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 2.chpl 331ms 1.5ms 32.9MB 320ms 0ms chpl 1.31.0
java 1.java 441ms 4.4ms 45.6MB 480ms 17ms openjdk 21
java 1.java 445ms 0.3ms 47.8MB 470ms 23ms openjdk 23
java 1.java 446ms 4.2ms 87.2MB 473ms 27ms graal/jvm 17.0.8
java 1.java 567ms 1.9ms 44.8MB 483ms 137ms openjdk/zgc 21
java 2.java 1234ms 16ms 564.0MB 1367ms 73ms openjdk 21
java 2.java 1244ms 9.3ms 758.8MB 1343ms 120ms openjdk 23
java 2.java 3320ms 110ms 2546.4MB 1653ms 1867ms openjdk/zgc 21

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 2.chpl 53ms 2.3ms 32.8MB 43ms 0ms chpl 1.31.0
java 1.java 117ms 3.9ms 45.5MB 150ms 17ms openjdk 21
java 1.java 122ms 1.4ms 48.3MB 157ms 17ms openjdk 23
java 1-m.java 131ms 2.3ms 85.4MB 163ms 33ms graal/jvm 17.0.8
java 1.java 244ms 1.6ms 46.4MB 157ms 140ms openjdk/zgc 21
java 2-m.java 301ms 3.3ms 346.2MB 433ms 60ms openjdk 21
java 2-m.java 315ms 9.1ms 412.2MB 433ms 80ms openjdk 23
java 2.java 700ms 2.1ms 533.6MB 483ms 410ms openjdk/zgc 21

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 2.chpl 455ms 1.8ms 32.4MB 447ms 0ms chpl 1.31.0
java 1.java 3232ms 17ms 447.0MB 3717ms 120ms graal/jvm 17.0.8
java 1.java 3703ms 78ms 397.8MB 4520ms 127ms openjdk 23
java 1.java 3744ms 13ms 356.5MB 4583ms 93ms openjdk 21
java 1.java timeout 0.0ms 1808.0MB 4677ms 1200ms openjdk/zgc 21

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 2.chpl 121ms 0.3ms 34.4MB 107ms 3ms chpl 1.31.0
java 1-m.java 913ms 27ms 448.8MB 1323ms 70ms graal/jvm 17.0.8
java 1-m.java 1024ms 17ms 352.6MB 1767ms 80ms openjdk 21
java 1-m.java 1034ms 15ms 473.2MB 1763ms 107ms openjdk 23
java 1.java 1985ms 0.8ms 1312.7MB 1740ms 1030ms openjdk/zgc 21

regex-redux

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 3.chpl 1396ms 10ms 224.1MB 1350ms 40ms chpl 1.31.0
java 3.java timeout 0.0ms 409.0MB 5410ms 90ms graal/jvm 17.0.8
java 3.java timeout 0.0ms 304.2MB 5307ms 73ms openjdk 21
java 3.java timeout 0.0ms 306.8MB 5310ms 73ms openjdk 23
java 3.java timeout 0.0ms 466.9MB 4937ms 330ms openjdk/zgc 21

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 3.chpl 167ms 3.3ms 53.0MB 153ms 7ms chpl 1.31.0
java 3-m.java 773ms 24ms 180.9MB 1133ms 67ms graal/jvm 17.0.8
java 3-m.java 809ms 29ms 131.9MB 1213ms 43ms openjdk 21
java 3-m.java 825ms 12ms 134.5MB 1220ms 37ms openjdk 23
java 3.java 977ms 40ms 133.9MB 1163ms 190ms openjdk/zgc 21

secp256k1

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1.chpl 1194ms 3.1ms 33.1MB 1180ms 3ms chpl 1.31.0

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1.chpl 313ms 4.6ms 33.1MB 307ms 0ms chpl 1.31.0

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1-m.chpl 1916ms 3.1ms 33.0MB 3793ms 3ms chpl 1.31.0
java 2-m.java 1948ms 13ms 47.8MB 7413ms 27ms openjdk 21
java 2-m.java 1964ms 8.0ms 48.6MB 7447ms 27ms openjdk 23
java 2-m.java 2087ms 5.7ms 47.2MB 7467ms 150ms openjdk/zgc 21
java 2-m.java 2479ms 18ms 100.1MB 8663ms 50ms graal/jvm 17.0.8
chapel 1.chpl 3743ms 27ms 32.8MB 3737ms 0ms chpl 1.31.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1-m.chpl 500ms 5.2ms 32.9MB 953ms 0ms chpl 1.31.0
java 2-m.java 585ms 4.5ms 47.8MB 2020ms 37ms openjdk 21
java 2-m.java 589ms 1.3ms 48.8MB 2057ms 23ms openjdk 23
java 2-m.java 709ms 1.6ms 45.4MB 2050ms 150ms openjdk/zgc 21
java 2-m.java 744ms 9.1ms 97.3MB 2500ms 47ms graal/jvm 17.0.8
chapel 1.chpl 945ms 2.1ms 32.6MB 937ms 0ms chpl 1.31.0

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1-m.chpl 151ms 7.1ms 32.9MB 260ms 3ms chpl 1.31.0
java 2-m.java 240ms 8.9ms 48.7MB 707ms 20ms openjdk 23
java 2-m.java 247ms 10ms 47.6MB 713ms 27ms openjdk 21
chapel 1.chpl 257ms 0.9ms 32.8MB 250ms 0ms chpl 1.31.0
java 2-m.java 276ms 6.0ms 98.1MB 780ms 40ms graal/jvm 17.0.8
java 2-m.java 383ms 12ms 45.4MB 743ms 150ms openjdk/zgc 21