Julia VS Java benchmarks

Current benchmark data was generated on Thu Sep 22 2022, 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 70ms 3.1ms 63.4MB 70ms 10ms graal/jvm 17.0.4
java 1.java 78ms 5.0ms 42.7MB 78ms 6ms openjdk 20
java 1.java 82ms 3.6ms 40.8MB 78ms 8ms openjdk 19
java 1.java 119ms 4.8ms 39.9MB 78ms 52ms openjdk/zgc 19
julia 1.jl 197ms 0.7ms 187.2MB 124ms 86ms julia 1.8.1
julia 1.jl 205ms 48ms 178.5MB 114ms 86ms julia/aot 1.8.1

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 1.java 539ms 2.8ms 86.1MB 583ms 20ms graal/jvm 17.0.4
julia 7.jl 554ms 1.2ms 180.3MB 510ms 120ms julia/aot 1.8.1
java 1.java 558ms 2.9ms 44.4MB 563ms 23ms openjdk 20
java 1.java 558ms 2.6ms 42.4MB 577ms 13ms openjdk 19
java 1.java 614ms 4.4ms 42.3MB 590ms 57ms openjdk/zgc 19
julia 7.jl 715ms 1.2ms 245.9MB 680ms 110ms julia 1.8.1
java 2.java 1887ms 33ms 538.3MB 1923ms 107ms openjdk 19
java 2.java 1923ms 9.6ms 563.7MB 1950ms 127ms openjdk 20
java 2.java 2582ms 4.7ms 1219.4MB 2027ms 753ms openjdk/zgc 19

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 1.java 142ms 3.9ms 42.7MB 157ms 17ms openjdk 20
java 1.java 144ms 1.6ms 86.4MB 190ms 20ms graal/jvm 17.0.4
java 1.java 146ms 5.8ms 42.7MB 167ms 10ms openjdk 19
java 1.java 190ms 3.5ms 42.2MB 160ms 57ms openjdk/zgc 19
julia 7.jl 285ms 60ms 182.1MB 203ms 127ms julia/aot 1.8.1
julia 7.jl 405ms 0.7ms 245.8MB 343ms 143ms julia 1.8.1
java 2.java 414ms 4.9ms 363.3MB 493ms 70ms openjdk 20
java 2.java 417ms 2.1ms 355.0MB 483ms 73ms openjdk 19
java 2.java 676ms 0.7ms 455.4MB 547ms 290ms openjdk/zgc 19

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
julia 1.jl 427ms 1.7ms 175.5MB 410ms 97ms julia/aot 1.8.1
julia 1.jl 538ms 1.0ms 220.4MB 510ms 110ms julia 1.8.1
java 1.java 781ms 22ms 88.1MB 807ms 23ms openjdk 20
java 1.java 922ms 29ms 84.4MB 943ms 23ms openjdk 19
java 1.java 982ms 26ms 110.6MB 940ms 87ms openjdk/zgc 19
java 2.java 1003ms 4.6ms 52.7MB 1043ms 13ms openjdk 20
java 2.java 1028ms 5.3ms 52.2MB 1010ms 60ms openjdk/zgc 19
java 2.java 1039ms 37ms 54.3MB 1077ms 17ms openjdk 19
java 1-m.java 1472ms 70ms 163.9MB 2240ms 53ms graal/jvm 17.0.4
java 2-m.java 1848ms 24ms 128.2MB 3400ms 50ms graal/jvm 17.0.4

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 1.java 236ms 2.7ms 62.5MB 270ms 13ms openjdk 20
java 1.java 237ms 4.6ms 62.3MB 257ms 27ms openjdk 19
julia 1.jl 239ms 30ms 169.1MB 187ms 87ms julia/aot 1.8.1
java 1.java 280ms 5.4ms 60.9MB 263ms 60ms openjdk/zgc 19
java 2.java 325ms 6.4ms 48.8MB 363ms 10ms openjdk 20
java 2.java 326ms 0.8ms 48.2MB 360ms 17ms openjdk 19
java 1-m.java 332ms 8.9ms 135.3MB 470ms 43ms graal/jvm 17.0.4
julia 1.jl 336ms 1.0ms 211.2MB 310ms 107ms julia 1.8.1
java 2.java 360ms 3.3ms 44.2MB 353ms 50ms openjdk/zgc 19
java 2-m.java 611ms 3.6ms 127.9MB 1100ms 33ms graal/jvm 17.0.4

binarytrees

Input: 18

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 2.java 664ms 1.0ms 413.9MB 690ms 83ms openjdk 20
java 2.java 690ms 43ms 602.5MB 673ms 120ms openjdk 19
java 2.java 744ms 45ms 680.0MB 807ms 163ms graal/jvm 17.0.4
julia 4.jl 1155ms 55ms 258.8MB 1073ms 157ms julia 1.8.1
java 2.java 1277ms 28ms 1069.2MB 903ms 583ms openjdk/zgc 19

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 2.java 164ms 6.4ms 109.4MB 170ms 23ms openjdk 19
java 2.java 174ms 14ms 111.4MB 163ms 37ms openjdk 20
java 2-m.java 182ms 6.2ms 168.4MB 240ms 40ms graal/jvm 17.0.4
java 2.java 300ms 5.7ms 243.7MB 187ms 153ms openjdk/zgc 19
julia 4.jl 307ms 1.6ms 240.5MB 250ms 133ms julia 1.8.1

fannkuch-redux

Input: 11

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 1-m.java 1676ms 23ms 100.6MB 3180ms 33ms graal/jvm 17.0.4
java 1-m.java 1702ms 47ms 43.8MB 3257ms 17ms openjdk 20
java 1-m.java 1722ms 18ms 43.8MB 3290ms 13ms openjdk 19
java 1-m.java 1731ms 12ms 42.4MB 3233ms 50ms openjdk/zgc 19
julia 2-m.jl 1825ms 22ms 230.2MB 3183ms 130ms julia 1.8.1

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 1-m.java 272ms 3.4ms 42.5MB 443ms 13ms openjdk 20
java 1-m.java 273ms 6.2ms 42.2MB 437ms 10ms openjdk 19
java 1-m.java 285ms 13ms 91.6MB 450ms 17ms graal/jvm 17.0.4
java 1-m.java 315ms 4.4ms 42.5MB 450ms 50ms openjdk/zgc 19
julia 2-m.jl 555ms 1.4ms 230.5MB 700ms 133ms julia 1.8.1

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 4.java 510ms 2.3ms 44.0MB 587ms 17ms openjdk 20
java 4.java 515ms 7.4ms 43.3MB 590ms 17ms openjdk 19
java 4.java 558ms 6.8ms 41.8MB 587ms 67ms openjdk/zgc 19
java 4-m.java 618ms 4.2ms 119.8MB 937ms 27ms graal/jvm 17.0.4
julia 7-m.jl 636ms 1.4ms 299.2MB 890ms 133ms julia 1.8.1

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 4.java 141ms 1.4ms 42.9MB 160ms 20ms openjdk 20
java 4.java 144ms 4.0ms 41.2MB 177ms 7ms openjdk 19
java 4.java 154ms 7.2ms 90.9MB 193ms 23ms graal/jvm 17.0.4
java 4.java 184ms 4.4ms 43.1MB 167ms 50ms openjdk/zgc 19
julia 7.jl 460ms 1.4ms 228.1MB 557ms 113ms julia 1.8.1

knucleotide

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
julia 8.jl 1162ms 1.6ms 318.3MB 1493ms 167ms julia 1.8.1
java 3-m.java 1454ms 18ms 114.9MB 2660ms 40ms openjdk 20
java 3-m.java 1468ms 27ms 117.1MB 2693ms 47ms openjdk 19
java 3-m.java 1599ms 70ms 191.0MB 2963ms 53ms graal/jvm 17.0.4
java 3-m.java 1935ms 42ms 175.5MB 3417ms 150ms openjdk/zgc 19

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 3-m.java 459ms 22ms 93.2MB 763ms 27ms openjdk 20
java 3-m.java 475ms 7.0ms 94.5MB 717ms 80ms openjdk/zgc 19
java 3-m.java 487ms 66ms 96.8MB 830ms 23ms openjdk 19
java 3-m.java 679ms 63ms 161.5MB 1190ms 40ms graal/jvm 17.0.4
julia 8.jl 817ms 3.9ms 303.8MB 927ms 123ms julia 1.8.1

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
julia 3.jl 793ms 3.9ms 196.0MB 767ms 100ms julia 1.8.1
julia 1.jl 1425ms 3.7ms 276.0MB 1337ms 170ms julia 1.8.1
java 1.java 4981ms 1.4ms 374.1MB 5360ms 117ms 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
julia 3.jl 349ms 1.4ms 193.8MB 310ms 120ms julia 1.8.1
julia 1.jl 801ms 26ms 277.4MB 707ms 157ms julia 1.8.1
java 1.java 1362ms 9.0ms 390.5MB 1710ms 97ms graal/jvm 17.0.4
java 1.java 1411ms 34ms 288.1MB 1777ms 70ms openjdk 19
java 1.java 1453ms 6.4ms 302.3MB 1863ms 57ms openjdk 20
java 1.java 1946ms 8.4ms 924.1MB 1807ms 637ms 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 1373ms 2.1ms 205.1MB 2407ms 117ms julia 1.8.1
julia 3-m.jl 2069ms 3.9ms 220.3MB 3703ms 130ms julia 1.8.1
java 2-m.java 4306ms 8.2ms 104.9MB 8330ms 30ms 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
julia 2-m.jl 582ms 1.2ms 206.8MB 873ms 103ms julia 1.8.1
julia 3-m.jl 795ms 4.6ms 219.1MB 1213ms 120ms julia 1.8.1
java 2-m.java 1270ms 5.6ms 108.9MB 2323ms 37ms graal/jvm 17.0.4
java 2-m.java 1647ms 83ms 44.4MB 3100ms 20ms openjdk 19
java 2-m.java 1733ms 180ms 44.2MB 3290ms 17ms openjdk 20
java 2-m.java 1755ms 197ms 42.6MB 3250ms 57ms openjdk/zgc 19

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
julia 2-m.jl 385ms 1.0ms 204.8MB 477ms 107ms julia 1.8.1
java 2-m.java 446ms 11ms 98.3MB 743ms 40ms graal/jvm 17.0.4
julia 3.jl 476ms 2.8ms 220.2MB 580ms 130ms julia 1.8.1
java 2-m.java 563ms 42ms 44.2MB 1017ms 10ms openjdk 20
java 2-m.java 582ms 12ms 44.6MB 1037ms 17ms openjdk 19
java 2-m.java 647ms 16ms 44.4MB 1083ms 50ms openjdk/zgc 19