All Java benchmarks

Current benchmark data was generated on Fri Jul 01 2022, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][2 cores] Intel(R) Xeon(R) Platinum 8171M 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

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.java 890ms 70ms 804.5MB 843ms 193ms openjdk 19
2.java 1007ms 17ms 603.0MB 877ms 260ms openjdk 18.0.1
2.java 1153ms 24ms 681.0MB 1063ms 223ms graal/jvm 17.0.3
2.java 1742ms 61ms 1231.9MB 1070ms 890ms openjdk/zgc 18.0.1

Input: 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.java 193ms 6.2ms 106.1MB 183ms 47ms openjdk 18.0.1
2.java 197ms 4.9ms 111.1MB 203ms 33ms openjdk 19
2.java 377ms 8.7ms 235.3MB 227ms 180ms openjdk/zgc 18.0.1
2.java 533ms 3.8ms 170.2MB 270ms 70ms graal/jvm 17.0.3

edigits

Input: 250001

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-m.java 901ms 33ms 218.9MB 1543ms 103ms openjdk 18.0.1
1-m.java 995ms 75ms 202.7MB 1730ms 107ms openjdk 19
1-m.java 1107ms 4.1ms 278.4MB 1617ms 137ms graal/jvm 17.0.3
1-m.java 1170ms 41ms 445.8MB 1680ms 383ms openjdk/zgc 18.0.1

Input: 100000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-m.java 468ms 17ms 112.1MB 747ms 53ms openjdk 18.0.1
1-m.java 538ms 14ms 117.8MB 873ms 70ms openjdk 19
1-m.java 605ms 85ms 220.3MB 827ms 197ms openjdk/zgc 18.0.1
1.java 790ms 27ms 185.3MB 763ms 70ms graal/jvm 17.0.3

fannkuch-redux

Input: 11

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-m.java 1869ms 121ms 119.3MB 3497ms 60ms graal/jvm 17.0.3
1-m.java 1938ms 27ms 41.2MB 3550ms 90ms openjdk/zgc 18.0.1
1-m.java 1942ms 24ms 40.8MB 3680ms 27ms openjdk 18.0.1
1-m.java 1984ms 59ms 41.7MB 3763ms 33ms openjdk 19

Input: 10

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-m.java 298ms 14ms 40.4MB 477ms 17ms openjdk 18.0.1
1-m.java 311ms 4.0ms 42.0MB 480ms 23ms openjdk 19
1-m.java 361ms 8.2ms 40.7MB 490ms 77ms openjdk/zgc 18.0.1
1.java 655ms 4.4ms 95.5MB 550ms 40ms graal/jvm 17.0.3

fasta

Input: 2500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
4.java 554ms 3.9ms 41.7MB 623ms 23ms openjdk 19
4.java 565ms 14ms 38.5MB 640ms 23ms openjdk 18.0.1
4.java 615ms 15ms 42.6MB 630ms 70ms openjdk/zgc 18.0.1
4.java 971ms 6.9ms 123.5MB 997ms 73ms graal/jvm 17.0.3

Input: 250000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
4.java 168ms 8.4ms 43.1MB 207ms 17ms openjdk 19
4.java 178ms 16ms 38.3MB 207ms 23ms openjdk 18.0.1
4.java 219ms 3.4ms 38.4MB 197ms 70ms openjdk/zgc 18.0.1
4.java 494ms 15ms 85.6MB 220ms 43ms graal/jvm 17.0.3

helloworld

Input: QwQ

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.java 87ms 1.6ms 64.6MB 82ms 20ms graal/jvm 17.0.3
1.java 95ms 1.7ms 40.2MB 86ms 18ms openjdk 19
1.java 96ms 5.2ms 37.4MB 80ms 24ms openjdk 18.0.1
1.java 152ms 6.3ms 38.3MB 104ms 64ms openjdk/zgc 18.0.1

knucleotide

Input: 2500000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3-m.java 1749ms 26ms 113.1MB 3187ms 50ms openjdk 18.0.1
3-m.java 1816ms 28ms 196.2MB 3307ms 110ms graal/jvm 17.0.3
3-m.java 1880ms 73ms 114.6MB 3413ms 67ms openjdk 19
3-m.java 2523ms 15ms 173.9MB 4407ms 220ms openjdk/zgc 18.0.1

Input: 250000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3-m.java 582ms 42ms 86.1MB 960ms 50ms openjdk 18.0.1
3-m.java 622ms 62ms 97.0MB 933ms 120ms openjdk/zgc 18.0.1
3-m.java 630ms 87ms 94.9MB 1073ms 43ms openjdk 19
3-m.java 1519ms 350ms 165.8MB 2677ms 83ms graal/jvm 17.0.3

mandelbrot

Input: 5000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1b.java 1835ms 34ms 48.4MB 1943ms 23ms openjdk 19
1b.java 1842ms 15ms 49.7MB 1963ms 23ms openjdk 18.0.1
1b.java 1909ms 29ms 49.1MB 1957ms 87ms openjdk/zgc 18.0.1
1b.java 1979ms 25ms 137.4MB 2320ms 60ms graal/jvm 17.0.3
1a.java 2200ms 24ms 47.7MB 2313ms 13ms openjdk 18.0.1
1a.java 2209ms 28ms 48.5MB 2313ms 27ms openjdk 19
1a.java 2282ms 52ms 123.5MB 2460ms 43ms graal/jvm 17.0.3
1a.java 2291ms 16ms 49.7MB 2303ms 87ms openjdk/zgc 18.0.1
1.java 2494ms 18ms 131.8MB 2673ms 50ms graal/jvm 17.0.3
1.java 2626ms 19ms 217.2MB 2677ms 60ms openjdk 18.0.1
1.java 2638ms 2.2ms 208.0MB 2693ms 63ms openjdk 19
1.java 2902ms 59ms 692.4MB 2527ms 497ms openjdk/zgc 18.0.1
2.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 18.0.1
2.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 19
2.java timeout 0.0ms 0.0MB 0ms 0ms openjdk/zgc 18.0.1

Input: 1000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1a.java 259ms 14ms 43.3MB 327ms 33ms openjdk 18.0.1
1.java 270ms 4.5ms 96.2MB 350ms 27ms openjdk 18.0.1
1.java 271ms 6.7ms 95.5MB 333ms 33ms openjdk 19
1b-m.java 275ms 7.2ms 46.0MB 387ms 27ms openjdk 19
1a.java 278ms 27ms 48.4MB 373ms 20ms openjdk 19
1b.java 278ms 16ms 43.0MB 373ms 27ms openjdk 18.0.1
1a.java 311ms 1.6ms 40.7MB 307ms 83ms openjdk/zgc 18.0.1
1b.java 314ms 11ms 44.1MB 340ms 77ms openjdk/zgc 18.0.1
1.java 373ms 17ms 109.5MB 347ms 100ms openjdk/zgc 18.0.1
1a.java 596ms 12ms 103.4MB 363ms 50ms graal/jvm 17.0.3
1.java 614ms 11ms 111.7MB 380ms 57ms graal/jvm 17.0.3
1b.java 647ms 30ms 121.3MB 490ms 57ms graal/jvm 17.0.3
2.java 972ms 13ms 559.4MB 1137ms 200ms openjdk 19
2.java 1160ms 21ms 596.0MB 1243ms 260ms openjdk 18.0.1
2.java 2119ms 23ms 1395.8MB 1360ms 1103ms openjdk/zgc 18.0.1

merkletrees

Input: 17

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.java 632ms 10ms 291.7MB 657ms 103ms openjdk 19
1.java 638ms 6.8ms 286.0MB 673ms 83ms openjdk 18.0.1
1.java 1027ms 2.8ms 365.7MB 880ms 157ms graal/jvm 17.0.3
1.java 1185ms 2.3ms 755.7MB 790ms 573ms openjdk/zgc 18.0.1

Input: 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.java 273ms 6.7ms 171.9MB 283ms 63ms openjdk 19
1.java 288ms 8.9ms 219.2MB 273ms 87ms openjdk 18.0.1
1.java 511ms 59ms 329.0MB 317ms 247ms openjdk/zgc 18.0.1
1.java 665ms 13ms 245.4MB 467ms 97ms graal/jvm 17.0.3

nbody

Input: 5000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.java 756ms 8.4ms 38.6MB 780ms 10ms openjdk 18.0.1
1.java 770ms 12ms 42.6MB 790ms 20ms openjdk 19
1.java 833ms 20ms 40.5MB 793ms 73ms openjdk/zgc 18.0.1
1.java 1006ms 4.3ms 81.6MB 723ms 33ms graal/jvm 17.0.3
2.java 2375ms 10ms 537.7MB 2387ms 170ms openjdk 18.0.1
2.java 2418ms 60ms 557.5MB 2433ms 173ms openjdk 19
2.java 3770ms 34ms 1620.7MB 2717ms 1297ms openjdk/zgc 18.0.1

Input: 500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.java 179ms 11ms 38.7MB 190ms 20ms openjdk 18.0.1
1.java 184ms 17ms 42.2MB 213ms 10ms openjdk 19
1.java 242ms 2.8ms 40.2MB 203ms 70ms openjdk/zgc 18.0.1
1.java 489ms 1.3ms 80.5MB 200ms 30ms graal/jvm 17.0.3
2.java 498ms 8.8ms 314.2MB 573ms 90ms openjdk 18.0.1
2.java 510ms 9.5ms 341.4MB 580ms 107ms openjdk 19
2.java 891ms 57ms 500.0MB 667ms 410ms openjdk/zgc 18.0.1

nsieve

Input: 12

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.java 1159ms 12ms 54.3MB 1230ms 17ms openjdk 19
2.java 1236ms 19ms 49.0MB 1280ms 20ms openjdk 18.0.1
2.java 1345ms 73ms 47.1MB 1327ms 73ms openjdk/zgc 18.0.1
1.java 1577ms 40ms 109.1MB 1503ms 123ms openjdk/zgc 18.0.1
1.java 1730ms 58ms 84.4MB 1757ms 37ms openjdk 19
1.java 1934ms 40ms 168.9MB 2797ms 83ms graal/jvm 17.0.3
1.java 1981ms 69ms 82.4MB 1990ms 47ms openjdk 18.0.1
2-m.java 2559ms 41ms 136.1MB 4713ms 97ms graal/jvm 17.0.3

Input: 10

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.java 336ms 16ms 59.1MB 380ms 17ms openjdk 18.0.1
1.java 344ms 13ms 59.8MB 383ms 23ms openjdk 19
2.java 370ms 2.6ms 50.3MB 413ms 27ms openjdk 19
1.java 377ms 17ms 57.4MB 340ms 90ms openjdk/zgc 18.0.1
2.java 385ms 5.5ms 43.0MB 433ms 20ms openjdk 18.0.1
2.java 460ms 12ms 43.5MB 437ms 83ms openjdk/zgc 18.0.1
1.java 717ms 8.5ms 138.8MB 570ms 60ms graal/jvm 17.0.3
2.java 1106ms 6.4ms 131.5MB 1490ms 77ms graal/jvm 17.0.3

pidigits

Input: 8000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.java timeout 0.0ms 0.0MB 0ms 0ms graal/jvm 17.0.3
1.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 18.0.1
1.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 19
1.java timeout 0.0ms 0.0MB 0ms 0ms openjdk/zgc 18.0.1

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.java 1704ms 15ms 289.7MB 2130ms 100ms openjdk 19
1.java 1822ms 13ms 246.6MB 2173ms 100ms openjdk 18.0.1
1.java 1850ms 15ms 373.6MB 2320ms 153ms graal/jvm 17.0.3
1.java 2559ms 80ms 1223.2MB 2367ms 960ms openjdk/zgc 18.0.1

regex-redux

Input: 2500000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3.java timeout 0.0ms 0.0MB 0ms 0ms graal/jvm 17.0.3
3.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 18.0.1
3.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 19
3.java timeout 0.0ms 0.0MB 0ms 0ms openjdk/zgc 18.0.1

Input: 250000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3.java 1228ms 8.8ms 112.6MB 1617ms 37ms openjdk 18.0.1
3.java 1244ms 47ms 192.9MB 1707ms 83ms graal/jvm 17.0.3
3.java 1246ms 9.5ms 110.4MB 1687ms 60ms openjdk 19
3.java 1412ms 72ms 157.8MB 1567ms 183ms openjdk/zgc 18.0.1

spectral-norm

Input: 8000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.java timeout 0.0ms 0.0MB 0ms 0ms graal/jvm 17.0.3
2.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 18.0.1
2.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 19
2.java timeout 0.0ms 0.0MB 0ms 0ms openjdk/zgc 18.0.1

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2-m.java 1550ms 34ms 117.9MB 2823ms 70ms graal/jvm 17.0.3
2-m.java 2865ms 230ms 38.9MB 5443ms 30ms openjdk 18.0.1
2-m.java 2949ms 67ms 44.0MB 5563ms 37ms openjdk 19
2-m.java 3008ms 195ms 40.6MB 5537ms 113ms openjdk/zgc 18.0.1

Input: 2000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2-m.java 845ms 28ms 40.5MB 1523ms 20ms openjdk 18.0.1
2.java 858ms 24ms 102.6MB 903ms 50ms graal/jvm 17.0.3
2-m.java 879ms 29ms 43.4MB 1547ms 23ms openjdk 19
2-m.java 925ms 3.9ms 40.6MB 1543ms 80ms openjdk/zgc 18.0.1

coro-prime-sieve

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.java timeout 0.0ms 0.0MB 0ms 0ms loom 19

Input: 1000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-m.java 791ms 57ms 95.3MB 1337ms 60ms loom 19