All Java benchmarks

Current benchmark data was generated on Fri Dec 09 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

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.java 716ms 45ms 606.1MB 660ms 143ms openjdk 20
2.java 755ms 58ms 601.4MB 667ms 173ms openjdk 19
2.java 758ms 24ms 665.8MB 790ms 197ms graal/jvm 17.0.5
2.java 1322ms 50ms 1009.4MB 903ms 640ms openjdk/zgc 19

Input: 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.java 176ms 4.8ms 111.0MB 160ms 43ms openjdk 19
2.java 178ms 10ms 108.0MB 160ms 40ms openjdk 20
2.java 204ms 10ms 161.8MB 227ms 57ms graal/jvm 17.0.5
2.java 334ms 12ms 240.0MB 177ms 180ms openjdk/zgc 19

edigits

Input: 250001

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-m.java 841ms 122ms 215.6MB 1477ms 67ms openjdk 20
1-m.java 866ms 96ms 204.6MB 1483ms 87ms openjdk 19
1-m.java 882ms 59ms 317.1MB 1523ms 113ms graal/jvm 17.0.5
1-m.java 1006ms 17ms 435.0MB 1433ms 323ms openjdk/zgc 19

Input: 100000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-m.java 430ms 37ms 166.7MB 680ms 63ms graal/jvm 17.0.5
1-m.java 432ms 11ms 115.8MB 690ms 53ms openjdk 19
1-m.java 443ms 26ms 117.3MB 717ms 50ms openjdk 20
1-m.java 595ms 83ms 224.6MB 823ms 183ms openjdk/zgc 19

fannkuch-redux

Input: 11

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-m.java 1476ms 70ms 90.2MB 2783ms 37ms graal/jvm 17.0.5
1-m.java 1511ms 22ms 40.6MB 2873ms 20ms openjdk 20
1-m.java 1523ms 12ms 42.0MB 2883ms 13ms openjdk 19
1-m.java 1601ms 34ms 43.8MB 2947ms 57ms openjdk/zgc 19

Input: 10

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-m.java 259ms 6.6ms 43.7MB 410ms 13ms openjdk 19
1-m.java 270ms 8.4ms 40.3MB 417ms 7ms openjdk 20
1-m.java 274ms 30ms 88.4MB 413ms 30ms graal/jvm 17.0.5
1.java 304ms 14ms 41.9MB 393ms 60ms openjdk/zgc 19

fasta

Input: 2500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
4.java 466ms 4.3ms 40.0MB 530ms 13ms openjdk 20
4.java 475ms 4.8ms 43.5MB 527ms 20ms openjdk 19
4.java 513ms 7.9ms 39.8MB 540ms 57ms openjdk/zgc 19
4-m.java 542ms 7.1ms 103.4MB 800ms 30ms graal/jvm 17.0.5

Input: 250000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
4.java 142ms 7.3ms 39.2MB 160ms 13ms openjdk 20
4.java 146ms 2.4ms 42.7MB 157ms 17ms openjdk 19
4.java 158ms 4.6ms 76.6MB 163ms 27ms graal/jvm 17.0.5
4.java 204ms 11ms 41.1MB 167ms 60ms openjdk/zgc 19

helloworld

Input: QwQ

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.java 77ms 6.0ms 61.5MB 65ms 15ms graal/jvm 17.0.5
1.java 81ms 8.0ms 41.8MB 80ms 8ms openjdk 19
1.java 85ms 6.9ms 39.1MB 72ms 18ms openjdk 20
1.java 134ms 6.1ms 41.5MB 78ms 60ms openjdk/zgc 19

knucleotide

Input: 2500000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3-m.java 1439ms 48ms 116.4MB 2610ms 43ms openjdk 19
3-m.java 1457ms 42ms 117.0MB 2613ms 60ms openjdk 20
3-m.java 1574ms 95ms 165.2MB 2857ms 70ms graal/jvm 17.0.5
3-m.java 1992ms 27ms 176.0MB 3443ms 177ms openjdk/zgc 19

Input: 250000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3-m.java 451ms 47ms 91.4MB 727ms 50ms openjdk 20
3-m.java 480ms 59ms 94.8MB 783ms 33ms openjdk 19
3-m.java 490ms 27ms 94.3MB 693ms 103ms openjdk/zgc 19
3-m.java 535ms 43ms 133.4MB 897ms 53ms graal/jvm 17.0.5

mandelbrot

Input: 5000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1b.java 1507ms 19ms 47.3MB 1593ms 13ms openjdk 20
1b.java 1519ms 23ms 48.4MB 1600ms 13ms openjdk 19
1b.java 1565ms 17ms 48.7MB 1577ms 73ms openjdk/zgc 19
1b.java 1602ms 47ms 107.3MB 1807ms 40ms graal/jvm 17.0.5
1a.java 1801ms 3.1ms 50.3MB 1857ms 30ms openjdk 19
1a.java 1809ms 22ms 47.5MB 1897ms 17ms openjdk 20
1a.java 1862ms 7.6ms 48.8MB 1860ms 70ms openjdk/zgc 19
1a.java 1982ms 107ms 109.6MB 2217ms 50ms graal/jvm 17.0.5
1.java 2046ms 4.0ms 135.9MB 2123ms 40ms graal/jvm 17.0.5
1.java 2056ms 118ms 190.3MB 2087ms 43ms openjdk 19
1.java 2144ms 18ms 203.6MB 2157ms 67ms openjdk 20
1.java 2533ms 4.6ms 559.1MB 2260ms 387ms openjdk/zgc 19
2.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 19
2.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 20
2.java timeout 0.0ms 0.0MB 0ms 0ms openjdk/zgc 19

Input: 1000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1a.java 217ms 9.8ms 46.9MB 270ms 17ms openjdk 19
1b.java 223ms 5.2ms 42.7MB 277ms 20ms openjdk 20
1b.java 223ms 3.9ms 48.0MB 283ms 17ms openjdk 19
1a.java 232ms 11ms 43.9MB 290ms 13ms openjdk 20
1.java 235ms 11ms 98.5MB 267ms 30ms openjdk 19
1.java 241ms 4.7ms 96.1MB 290ms 23ms openjdk 20
1a.java 241ms 7.6ms 91.6MB 303ms 33ms graal/jvm 17.0.5
1a.java 269ms 3.4ms 46.3MB 260ms 70ms openjdk/zgc 19
1b.java 271ms 18ms 46.0MB 293ms 57ms openjdk/zgc 19
1.java 289ms 41ms 152.8MB 393ms 30ms graal/jvm 17.0.5
1b-m.java 306ms 59ms 99.1MB 440ms 37ms graal/jvm 17.0.5
1.java 313ms 7.3ms 113.3MB 313ms 90ms openjdk/zgc 19
2.java 810ms 14ms 589.2MB 967ms 147ms openjdk 20
2.java 812ms 90ms 660.7MB 927ms 180ms openjdk 19
2.java 1517ms 124ms 1132.9MB 1043ms 747ms openjdk/zgc 19

merkletrees

Input: 17

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.java 573ms 20ms 366.9MB 570ms 87ms openjdk 19
1.java 585ms 0.5ms 370.6MB 587ms 97ms openjdk 20
1.java 599ms 18ms 429.0MB 730ms 117ms graal/jvm 17.0.5
1.java 1039ms 2.3ms 746.6MB 667ms 507ms openjdk/zgc 19

Input: 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.java 240ms 4.4ms 174.2MB 243ms 47ms openjdk 19
1.java 254ms 7.8ms 221.2MB 250ms 57ms openjdk 20
1-m.java 299ms 12ms 274.7MB 387ms 80ms graal/jvm 17.0.5
1.java 456ms 12ms 325.4MB 270ms 237ms openjdk/zgc 19

nbody

Input: 5000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.java 576ms 2.6ms 87.1MB 587ms 37ms graal/jvm 17.0.5
1.java 639ms 3.0ms 40.2MB 643ms 17ms openjdk 20
1.java 646ms 5.7ms 43.3MB 643ms 23ms openjdk 19
1.java 693ms 13ms 43.3MB 637ms 67ms openjdk/zgc 19
2.java 2094ms 4.8ms 528.4MB 2043ms 157ms openjdk 19
2.java 2114ms 45ms 532.5MB 2100ms 157ms openjdk 20
2.java 2729ms 7.2ms 1159.4MB 2147ms 783ms openjdk/zgc 19

Input: 500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.java 151ms 3.8ms 83.2MB 173ms 23ms graal/jvm 17.0.5
1.java 160ms 10ms 40.2MB 170ms 17ms openjdk 20
1.java 161ms 12ms 42.3MB 157ms 20ms openjdk 19
1.java 210ms 5.7ms 42.3MB 157ms 73ms openjdk/zgc 19
2.java 454ms 6.0ms 339.6MB 493ms 87ms openjdk 19
2.java 463ms 15ms 349.8MB 483ms 107ms openjdk 20
2.java 779ms 3.8ms 500.2MB 547ms 370ms openjdk/zgc 19

nsieve

Input: 12

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.java 935ms 11ms 84.4MB 957ms 23ms openjdk 19
1.java 966ms 3.9ms 84.0MB 990ms 20ms openjdk 20
2.java 1021ms 3.8ms 50.9MB 1053ms 17ms openjdk 20
2.java 1054ms 9.1ms 54.1MB 1073ms 17ms openjdk 19
2.java 1120ms 3.8ms 52.4MB 1097ms 67ms openjdk/zgc 19
1.java 1215ms 23ms 112.0MB 1157ms 100ms openjdk/zgc 19
1.java 1392ms 13ms 239.0MB 1927ms 103ms graal/jvm 17.0.5
2-m.java 1928ms 136ms 237.6MB 3393ms 107ms graal/jvm 17.0.5

Input: 10

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.java 245ms 1.5ms 58.0MB 263ms 20ms openjdk 20
1.java 252ms 0.2ms 60.1MB 270ms 20ms openjdk 19
1.java 311ms 6.4ms 60.7MB 257ms 87ms openjdk/zgc 19
2.java 320ms 1.9ms 44.2MB 353ms 7ms openjdk 20
2.java 333ms 4.5ms 47.9MB 347ms 20ms openjdk 19
1-m.java 345ms 6.0ms 150.7MB 470ms 50ms graal/jvm 17.0.5
2.java 388ms 3.2ms 45.7MB 363ms 63ms openjdk/zgc 19
2-m.java 678ms 4.9ms 152.9MB 1190ms 63ms graal/jvm 17.0.5

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.5
1.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 19
1.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 20
1.java timeout 0.0ms 0.0MB 0ms 0ms openjdk/zgc 19

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.java 1411ms 13ms 274.7MB 1673ms 87ms openjdk 20
1.java 1432ms 9.2ms 286.8MB 1687ms 103ms openjdk 19
1.java 1516ms 1.6ms 328.1MB 1873ms 110ms graal/jvm 17.0.5
1.java 2019ms 17ms 1012.1MB 1593ms 743ms openjdk/zgc 19

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.5
3.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 19
3.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 20
3.java timeout 0.0ms 0.0MB 0ms 0ms openjdk/zgc 19

Input: 250000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3.java 995ms 11ms 164.1MB 1407ms 47ms graal/jvm 17.0.5
3.java 1004ms 9.1ms 111.2MB 1293ms 47ms openjdk 19
3.java 1007ms 10ms 115.9MB 1317ms 40ms openjdk 20
3.java 1137ms 39ms 157.2MB 1277ms 133ms openjdk/zgc 19

spectral-norm

Input: 8000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2-m.java 4297ms 15ms 88.3MB 8307ms 30ms graal/jvm 17.0.5
2.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 19
2.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 20
2.java timeout 0.0ms 0.0MB 0ms 0ms openjdk/zgc 19

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2-m.java 1239ms 6.4ms 90.0MB 2277ms 33ms graal/jvm 17.0.5
2-m.java 1617ms 25ms 45.9MB 3067ms 10ms openjdk 19
2-m.java 1688ms 4.6ms 41.9MB 3097ms 67ms openjdk/zgc 19
2-m.java 1696ms 31ms 40.6MB 3223ms 7ms openjdk 20

Input: 2000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2-m.java 439ms 25ms 87.5MB 717ms 27ms graal/jvm 17.0.5
2-m.java 564ms 41ms 40.8MB 977ms 30ms openjdk 20
2-m.java 581ms 13ms 42.5MB 1020ms 10ms openjdk 19
2-m.java 632ms 43ms 44.0MB 1020ms 67ms openjdk/zgc 19

coro-prime-sieve

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-m.java 3437ms 105ms 198.7MB 6510ms 107ms openjdk 19
1-m.java 4140ms 61ms 948.2MB 7270ms 600ms openjdk/zgc 19
1.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 20

Input: 1000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-m.java 728ms 34ms 105.2MB 1293ms 40ms openjdk 20
1-m.java 765ms 58ms 113.7MB 1333ms 60ms openjdk 19
1-m.java 945ms 83ms 291.8MB 1393ms 203ms openjdk/zgc 19