Julia VS Java benchmarks

Current benchmark data was generated on Sun Jan 29 2023, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][2 cores] Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz (Model 106)

* -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.)

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 1.java 73ms 5.0ms 69.5MB 72ms 10ms graal/jvm 17.0.6
java 1.java 79ms 5.0ms 39.2MB 72ms 10ms openjdk 20
java 1.java 81ms 6.4ms 41.7MB 80ms 4ms openjdk 19
java 1.java 118ms 0.9ms 40.0MB 76ms 48ms openjdk/zgc 19
julia 1.jl 179ms 0.4ms 163.9MB 114ms 70ms julia/aot 1.8.5
julia 1.jl 194ms 1.8ms 171.2MB 132ms 76ms julia 1.8.5

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
julia 7.jl 549ms 0.1ms 168.6MB 507ms 120ms julia/aot 1.8.5
java 1.java 552ms 11ms 91.5MB 587ms 23ms graal/jvm 17.0.6
java 1.java 568ms 4.1ms 41.7MB 570ms 20ms openjdk 20
java 1.java 569ms 3.5ms 42.5MB 583ms 13ms openjdk 19
java 1.java 613ms 4.2ms 41.7MB 590ms 43ms openjdk/zgc 19
julia 7.jl 709ms 1.2ms 224.5MB 663ms 120ms julia 1.8.5
java 2.java 1893ms 20ms 560.5MB 1923ms 103ms openjdk 20
java 2.java 1917ms 37ms 504.3MB 1953ms 110ms openjdk 19
java 2.java 2583ms 5.9ms 1215.9MB 2013ms 753ms openjdk/zgc 19

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 1.java 141ms 2.6ms 88.3MB 177ms 20ms graal/jvm 17.0.6
java 1.java 150ms 5.2ms 40.8MB 160ms 7ms openjdk 20
java 1.java 151ms 5.1ms 42.6MB 167ms 10ms openjdk 19
java 1.java 188ms 3.2ms 44.0MB 160ms 47ms openjdk/zgc 19
julia 7.jl 246ms 3.3ms 169.8MB 210ms 100ms julia/aot 1.8.5
julia 7.jl 395ms 6.8ms 223.7MB 333ms 133ms julia 1.8.5
java 2.java 416ms 24ms 323.9MB 487ms 63ms openjdk 19
java 2.java 423ms 14ms 292.4MB 500ms 60ms openjdk 20
java 2.java 710ms 38ms 521.9MB 533ms 323ms openjdk/zgc 19

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
julia 1.jl 423ms 0.6ms 156.3MB 390ms 113ms julia/aot 1.8.5
julia 1.jl 528ms 2.4ms 203.3MB 487ms 113ms julia 1.8.5
java 1.java 727ms 58ms 84.4MB 750ms 20ms openjdk 19
java 1.java 731ms 58ms 82.8MB 750ms 17ms openjdk 20
java 1.java 886ms 17ms 110.3MB 833ms 87ms openjdk/zgc 19
java 2.java 1006ms 4.8ms 50.4MB 1030ms 17ms openjdk 20
java 2.java 1027ms 10ms 50.6MB 1007ms 53ms openjdk/zgc 19
java 2.java 1031ms 14ms 54.2MB 1053ms 13ms openjdk 19
java 1-m.java 1154ms 57ms 242.5MB 1697ms 77ms graal/jvm 17.0.6
java 2-m.java 1762ms 128ms 223.2MB 3120ms 73ms graal/jvm 17.0.6

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
julia 1.jl 220ms 2.5ms 150.2MB 177ms 87ms julia/aot 1.8.5
java 1.java 236ms 3.4ms 58.8MB 260ms 10ms openjdk 20
java 1.java 244ms 7.4ms 61.9MB 263ms 13ms openjdk 19
java 1.java 281ms 6.3ms 60.8MB 263ms 50ms openjdk/zgc 19
julia 1.jl 326ms 1.7ms 195.1MB 293ms 113ms julia 1.8.5
java 2.java 326ms 2.4ms 44.5MB 360ms 17ms openjdk 20
java 2.java 329ms 2.4ms 48.2MB 360ms 10ms openjdk 19
java 1-m.java 335ms 11ms 143.4MB 473ms 33ms graal/jvm 17.0.6
java 2.java 359ms 9.8ms 46.0MB 347ms 50ms openjdk/zgc 19
java 2-m.java 621ms 17ms 150.6MB 1090ms 43ms graal/jvm 17.0.6

binarytrees

Input: 18

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 2.java 665ms 13ms 411.6MB 690ms 77ms openjdk 20
java 2.java 706ms 38ms 602.6MB 703ms 100ms openjdk 19
java 2.java 758ms 74ms 666.2MB 807ms 170ms graal/jvm 17.0.6
julia 4.jl 1112ms 26ms 239.5MB 1023ms 163ms julia 1.8.5
java 2.java 1295ms 55ms 1100.1MB 897ms 600ms openjdk/zgc 19

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 2-m.java 166ms 1.5ms 166.6MB 200ms 53ms graal/jvm 17.0.6
java 2.java 169ms 16ms 108.1MB 167ms 23ms openjdk 20
java 2.java 175ms 15ms 110.8MB 190ms 13ms openjdk 19
julia 4.jl 304ms 1.4ms 221.2MB 263ms 120ms julia 1.8.5
java 2.java 305ms 2.4ms 237.9MB 167ms 160ms openjdk/zgc 19

fannkuch-redux

Input: 11

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 1-m.java 1661ms 28ms 94.9MB 3153ms 27ms graal/jvm 17.0.6
java 1-m.java 1722ms 52ms 42.1MB 3217ms 53ms openjdk/zgc 19
java 1-m.java 1724ms 16ms 40.7MB 3307ms 10ms openjdk 20
java 1-m.java 1770ms 156ms 43.2MB 3267ms 13ms openjdk 19
julia 2-m.jl 1775ms 12ms 210.1MB 3120ms 127ms julia 1.8.5

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 1-m.java 275ms 2.4ms 40.7MB 453ms 10ms openjdk 20
java 1-m.java 276ms 5.6ms 41.9MB 443ms 13ms openjdk 19
java 1-m.java 289ms 11ms 92.7MB 460ms 27ms graal/jvm 17.0.6
java 1-m.java 327ms 0.8ms 43.8MB 437ms 57ms openjdk/zgc 19
julia 2-m.jl 527ms 5.9ms 209.8MB 693ms 117ms julia 1.8.5

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 4.java 517ms 6.4ms 40.5MB 580ms 17ms openjdk 20
java 4.java 520ms 2.8ms 43.5MB 600ms 7ms openjdk 19
java 4.java 561ms 7.6ms 41.9MB 587ms 53ms openjdk/zgc 19
julia 7-m.jl 630ms 2.1ms 291.8MB 860ms 147ms julia 1.8.5
java 4.java 633ms 35ms 97.1MB 800ms 20ms graal/jvm 17.0.6

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 4.java 147ms 6.6ms 41.1MB 170ms 10ms openjdk 19
java 4.java 151ms 6.2ms 86.0MB 173ms 20ms graal/jvm 17.0.6
java 4.java 153ms 4.2ms 39.7MB 177ms 7ms openjdk 20
java 4.java 198ms 6.1ms 41.3MB 180ms 43ms openjdk/zgc 19
julia 7-m.jl 451ms 0.5ms 226.0MB 563ms 117ms julia 1.8.5

knucleotide

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
julia 8.jl 1118ms 9.1ms 273.3MB 1470ms 157ms julia 1.8.5
java 3-m.java 1430ms 19ms 115.1MB 2607ms 33ms openjdk 20
java 3-m.java 1469ms 22ms 115.8MB 2673ms 37ms openjdk 19
java 3-m.java 1527ms 56ms 169.6MB 2787ms 50ms graal/jvm 17.0.6
java 3-m.java 1925ms 14ms 173.7MB 3393ms 130ms openjdk/zgc 19

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 3-m.java 466ms 17ms 137.1MB 790ms 30ms graal/jvm 17.0.6
java 3-m.java 500ms 58ms 91.1MB 820ms 43ms openjdk 20
java 3-m.java 508ms 27ms 97.9MB 773ms 73ms openjdk/zgc 19
java 3-m.java 528ms 32ms 98.6MB 893ms 30ms openjdk 19
julia 8.jl 763ms 4.0ms 259.1MB 847ms 143ms julia 1.8.5

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
julia 3.jl 791ms 4.6ms 176.9MB 760ms 103ms julia 1.8.5
julia 1.jl 1373ms 3.2ms 260.8MB 1303ms 147ms julia 1.8.5
java 1.java 4962ms 11ms 314.2MB 5410ms 93ms graal/jvm 17.0.6
java 1.java timeout 0.0ms 270.3MB 5407ms 73ms openjdk 19
java 1.java timeout 0.0ms 292.5MB 5443ms 83ms openjdk 20
java 1.java timeout 0.0ms 1158.3MB 5100ms 633ms openjdk/zgc 19

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
julia 3.jl 342ms 0.3ms 176.2MB 307ms 113ms julia 1.8.5
julia 1.jl 780ms 23ms 261.5MB 710ms 133ms julia 1.8.5
java 1.java 1325ms 8.7ms 299.0MB 1697ms 70ms graal/jvm 17.0.6
java 1.java 1420ms 34ms 251.1MB 1793ms 63ms openjdk 19
java 1.java 1426ms 20ms 256.2MB 1757ms 70ms openjdk 20
java 1.java 1990ms 61ms 1047.5MB 1943ms 610ms openjdk/zgc 19

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
julia 2-m.jl 1370ms 7.3ms 192.9MB 2410ms 103ms julia 1.8.5
julia 3-m.jl 2107ms 0.8ms 211.4MB 3787ms 123ms julia 1.8.5
java 2-m.java 4292ms 31ms 91.3MB 8270ms 37ms graal/jvm 17.0.6
java 2.java timeout 0.0ms 43.8MB 9717ms 17ms openjdk 19
java 2.java timeout 0.0ms 40.4MB 9713ms 13ms openjdk 20
java 2.java timeout 0.0ms 43.7MB 9647ms 43ms openjdk/zgc 19

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
julia 2-m.jl 578ms 0.1ms 192.5MB 853ms 110ms julia 1.8.5
julia 3-m.jl 804ms 1.2ms 210.3MB 1233ms 120ms julia 1.8.5
java 2-m.java 1230ms 14ms 92.6MB 2260ms 30ms graal/jvm 17.0.6
java 2-m.java 1659ms 48ms 42.4MB 3133ms 10ms openjdk 19
java 2-m.java 1774ms 175ms 43.5MB 3273ms 53ms openjdk/zgc 19
java 2-m.java 1973ms 14ms 40.9MB 3773ms 10ms openjdk 20

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
julia 2-m.jl 381ms 2.7ms 192.3MB 467ms 113ms julia 1.8.5
java 2-m.java 432ms 15ms 91.2MB 733ms 20ms graal/jvm 17.0.6
julia 3.jl 477ms 5.1ms 211.5MB 577ms 137ms julia 1.8.5
java 2-m.java 579ms 39ms 42.3MB 1013ms 13ms openjdk 19
java 2-m.java 580ms 26ms 40.9MB 1030ms 13ms openjdk 20
java 2-m.java 626ms 51ms 43.4MB 1030ms 50ms openjdk/zgc 19