Rust VS Java benchmarks

Current benchmark data was generated on Fri Sep 30 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.)

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 5-m.rs 183ms 3.3ms 1.2MB 327ms 0ms rustc 1.64.0
rust 5c-m.rs 183ms 2.1ms 1.2MB 317ms 0ms rustc 1.66.0-nightly
rust 1c.rs 220ms 0.2ms 0.7MB 210ms 0ms rustc 1.66.0-nightly
rust 1.rs 262ms 1.2ms 0.6MB 250ms 0ms rustc 1.64.0
java 4.java 466ms 12ms 41.7MB 540ms 17ms openjdk 19
java 4.java 470ms 6.4ms 43.9MB 547ms 13ms openjdk 20
java 4.java 526ms 14ms 43.5MB 547ms 70ms openjdk/zgc 19
java 4-m.java 549ms 6.3ms 118.4MB 850ms 47ms graal/jvm 17.0.4

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 1c.rs 25ms 1.9ms 0.6MB 17ms 0ms rustc 1.66.0-nightly
rust 5c-m.rs 27ms 3.2ms 1.3MB 33ms 0ms rustc 1.66.0-nightly
rust 5-m.rs 29ms 1.9ms 1.3MB 33ms 0ms rustc 1.64.0
rust 1.rs 30ms 1.8ms 0.6MB 20ms 0ms rustc 1.64.0
java 4.java 142ms 2.0ms 41.3MB 160ms 10ms openjdk 19
java 4.java 142ms 1.7ms 42.9MB 157ms 20ms openjdk 20
java 4.java 156ms 7.9ms 82.9MB 173ms 37ms graal/jvm 17.0.4
java 4.java 201ms 3.0ms 41.3MB 170ms 63ms openjdk/zgc 19

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 1.rs 1.8ms 0.4ms 0.6MB 0ms 0ms rustc 1.66.0-nightly
rust 1.rs 2.0ms 0.8ms 0.6MB 0ms 0ms rustc 1.64.0
java 1.java 77ms 2.0ms 58.0MB 70ms 14ms graal/jvm 17.0.4
java 1.java 83ms 3.5ms 40.6MB 80ms 10ms openjdk 20
java 1.java 89ms 4.9ms 40.5MB 78ms 10ms openjdk 19
java 1.java 136ms 2.5ms 39.9MB 80ms 68ms openjdk/zgc 19

mandelbrot

Input: 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 9.rs 360ms 1.1ms 4.9MB 350ms 0ms rustc 1.66.0-nightly
rust 8.rs 501ms 0.8ms 4.9MB 490ms 0ms rustc 1.64.0
java 1b.java 1497ms 25ms 48.4MB 1597ms 13ms openjdk 19
java 1b.java 1521ms 27ms 50.8MB 1620ms 10ms openjdk 20
java 1b.java 1562ms 7.1ms 49.0MB 1590ms 70ms openjdk/zgc 19
java 1b.java 1590ms 16ms 122.6MB 1760ms 43ms graal/jvm 17.0.4
java 1a.java 1801ms 9.1ms 50.4MB 1880ms 23ms openjdk 20
java 1a.java 1818ms 33ms 48.6MB 1910ms 27ms openjdk 19
java 1a.java 1870ms 9.2ms 114.0MB 1970ms 33ms graal/jvm 17.0.4
java 1a.java 1875ms 16ms 49.8MB 1897ms 77ms openjdk/zgc 19
java 1.java 2059ms 4.7ms 121.0MB 2150ms 50ms graal/jvm 17.0.4
java 1.java 2148ms 6.1ms 198.9MB 2167ms 73ms openjdk 19
java 1.java 2169ms 15ms 192.9MB 2217ms 57ms openjdk 20
java 1.java 2585ms 4.9ms 567.8MB 2297ms 397ms openjdk/zgc 19
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: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 9.rs 18ms 0.6ms 0.6MB 10ms 0ms rustc 1.66.0-nightly
rust 8.rs 24ms 0.3ms 0.6MB 10ms 0ms rustc 1.64.0
java 1b.java 222ms 14ms 45.6MB 287ms 20ms openjdk 19
java 1b.java 222ms 4.0ms 44.2MB 310ms 13ms openjdk 20
java 1a.java 233ms 11ms 48.5MB 303ms 20ms openjdk 19
java 1.java 234ms 4.7ms 95.2MB 290ms 27ms openjdk 19
java 1.java 234ms 2.5ms 97.8MB 277ms 20ms openjdk 20
java 1a.java 247ms 7.5ms 101.0MB 317ms 40ms graal/jvm 17.0.4
java 1a.java 248ms 25ms 46.5MB 330ms 20ms openjdk 20
java 1.java 258ms 1.4ms 107.1MB 327ms 40ms graal/jvm 17.0.4
java 1b.java 279ms 12ms 45.9MB 300ms 67ms openjdk/zgc 19
java 1a.java 282ms 13ms 44.8MB 277ms 70ms openjdk/zgc 19
java 1b-m.java 292ms 28ms 119.1MB 423ms 37ms graal/jvm 17.0.4
java 1.java 316ms 3.9ms 111.4MB 273ms 110ms openjdk/zgc 19
java 2.java 876ms 31ms 571.2MB 1007ms 177ms openjdk 20
java 2.java 932ms 20ms 552.5MB 1033ms 197ms openjdk 19
java 2.java 1669ms 55ms 1124.2MB 1150ms 790ms openjdk/zgc 19

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 4-i.rs 207ms 1.2ms 0.6MB 197ms 0ms rustc 1.64.0
rust 7-i.rs 287ms 0.9ms 0.6MB 277ms 0ms rustc 1.64.0
rust 3.rs 342ms 0.5ms 0.7MB 330ms 0ms rustc 1.66.0-nightly
rust 2.rs 359ms 3.4ms 0.6MB 347ms 0ms rustc 1.64.0
rust 1.rs 415ms 5.8ms 0.6MB 407ms 0ms rustc 1.64.0
java 1.java 586ms 6.5ms 87.4MB 627ms 30ms graal/jvm 17.0.4
java 1.java 638ms 5.0ms 44.2MB 647ms 20ms openjdk 19
java 1.java 643ms 3.3ms 42.4MB 650ms 23ms openjdk 20
java 1.java 705ms 4.7ms 42.0MB 663ms 73ms openjdk/zgc 19
java 2.java 2299ms 9.1ms 534.4MB 2290ms 163ms openjdk 20
java 2.java 2309ms 29ms 487.1MB 2310ms 157ms openjdk 19
java 2.java 3386ms 50ms 1654.7MB 2387ms 1197ms openjdk/zgc 19

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 4-i.rs 24ms 1.2ms 0.6MB 13ms 0ms rustc 1.64.0
rust 7-i.rs 31ms 0.3ms 0.6MB 20ms 0ms rustc 1.64.0
rust 3.rs 37ms 0.5ms 0.7MB 30ms 0ms rustc 1.66.0-nightly
rust 2.rs 38ms 0.1ms 0.6MB 30ms 0ms rustc 1.64.0
rust 1.rs 45ms 0.9ms 0.6MB 33ms 0ms rustc 1.64.0
java 1.java 157ms 3.9ms 42.3MB 170ms 10ms openjdk 19
java 1.java 157ms 4.7ms 42.7MB 170ms 20ms openjdk 20
java 1.java 157ms 3.0ms 87.9MB 203ms 23ms graal/jvm 17.0.4
java 1.java 214ms 4.5ms 43.5MB 183ms 63ms openjdk/zgc 19
java 2.java 480ms 11ms 354.0MB 527ms 93ms openjdk 20
java 2.java 482ms 9.4ms 345.0MB 523ms 103ms openjdk 19
java 2.java 802ms 2.3ms 484.3MB 590ms 367ms openjdk/zgc 19

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 8-m.rs 889ms 1.1ms 2.6MB 1713ms 0ms rustc 1.66.0-nightly
rust 7-m.rs 892ms 0.5ms 2.2MB 1720ms 0ms rustc 1.64.0
rust 8.rs 1718ms 0.1ms 2.5MB 1703ms 0ms rustc 1.66.0-nightly
rust 7.rs 1719ms 0.9ms 2.2MB 1707ms 0ms rustc 1.64.0
rust 2-m.rs 1831ms 13ms 4.0MB 3530ms 3ms rustc 1.64.0
java 2-m.java 4360ms 25ms 107.0MB 8363ms 43ms 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
rust 2.rs timeout 0.0ms 0.0MB 0ms 0ms rustc 1.64.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 8-m.rs 233ms 1.4ms 2.3MB 427ms 0ms rustc 1.66.0-nightly
rust 7-m.rs 233ms 0.5ms 0.7MB 427ms 0ms rustc 1.64.0
rust 8.rs 432ms 0.3ms 2.2MB 420ms 0ms rustc 1.66.0-nightly
rust 7.rs 435ms 1.6ms 0.6MB 423ms 0ms rustc 1.64.0
rust 2-m.rs 465ms 0.7ms 2.3MB 877ms 0ms rustc 1.64.0
java 2-m.java 1256ms 53ms 103.4MB 2277ms 47ms graal/jvm 17.0.4
rust 2.rs 1551ms 0.4ms 0.6MB 1540ms 0ms rustc 1.64.0
java 2-m.java 1633ms 55ms 42.8MB 3080ms 23ms openjdk 20
java 2-m.java 1736ms 112ms 45.0MB 3293ms 10ms openjdk 19
java 2-m.java 1749ms 139ms 42.7MB 3200ms 77ms openjdk/zgc 19

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 8-m.rs 64ms 0.7ms 2.2MB 107ms 0ms rustc 1.66.0-nightly
rust 7-m.rs 66ms 2.4ms 0.7MB 110ms 0ms rustc 1.64.0
rust 8.rs 111ms 0.9ms 2.2MB 100ms 0ms rustc 1.66.0-nightly
rust 7.rs 111ms 1.0ms 0.6MB 100ms 0ms rustc 1.64.0
rust 2-m.rs 125ms 1.5ms 0.7MB 217ms 0ms rustc 1.64.0
rust 2.rs 391ms 1.3ms 0.6MB 380ms 0ms rustc 1.64.0
java 2-m.java 436ms 26ms 100.2MB 727ms 37ms graal/jvm 17.0.4
java 2-m.java 577ms 28ms 44.3MB 1013ms 20ms openjdk 20
java 2-m.java 583ms 8.5ms 43.6MB 1033ms 7ms openjdk 19
java 2-m.java 632ms 24ms 44.2MB 1010ms 77ms openjdk/zgc 19

binarytrees

Input: 18

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 2.java 766ms 12ms 414.2MB 733ms 123ms openjdk 20
java 2.java 785ms 6.1ms 409.0MB 753ms 127ms openjdk 19
java 2.java 804ms 24ms 683.4MB 853ms 203ms graal/jvm 17.0.4
java 2.java 1479ms 49ms 1081.8MB 1013ms 687ms openjdk/zgc 19
rust 4.rs 1768ms 38ms 33.7MB 1743ms 10ms rustc 1.64.0
rust 5.rs 1899ms 6.4ms 33.8MB 1880ms 3ms rustc 1.64.0
rust 3.rs 2017ms 65ms 49.9MB 1977ms 20ms rustc 1.64.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 4.rs 157ms 0.7ms 5.6MB 143ms 0ms rustc 1.64.0
rust 3.rs 167ms 4.4ms 7.8MB 153ms 0ms rustc 1.64.0
rust 5.rs 168ms 0.6ms 6.0MB 157ms 0ms rustc 1.64.0
java 2.java 179ms 6.1ms 109.2MB 173ms 30ms openjdk 19
java 2.java 185ms 15ms 110.9MB 183ms 27ms openjdk 20
java 2.java 210ms 21ms 165.1MB 253ms 43ms graal/jvm 17.0.4
java 2.java 345ms 11ms 240.4MB 183ms 193ms openjdk/zgc 19

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 3-m.rs 937ms 22ms 6.0MB 1790ms 30ms rustc 1.64.0
rust 5-m.rs 1022ms 195ms 5.4MB 1947ms 27ms rustc 1.64.0
rust 3.rs 1817ms 12ms 6.5MB 1773ms 27ms rustc 1.64.0
rust 4.rs 3031ms 1.3ms 4.5MB 3020ms 0ms rustc 1.64.0
java 1-m.java 3298ms 52ms 201.3MB 6173ms 120ms openjdk 19
rust 1-m.rs 3311ms 68ms 5.3MB 6430ms 60ms rustc 1.64.0
java 1-m.java 4199ms 57ms 944.9MB 7373ms 620ms openjdk/zgc 19
java 1.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 20

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 3-m.rs 76ms 2.3ms 3.0MB 117ms 10ms rustc 1.64.0
rust 5-m.rs 94ms 9.1ms 2.8MB 160ms 0ms rustc 1.64.0
rust 3.rs 112ms 0.5ms 3.1MB 97ms 0ms rustc 1.64.0
rust 4.rs 200ms 1.7ms 2.6MB 183ms 0ms rustc 1.64.0
rust 1-m.rs 222ms 3.7ms 2.9MB 400ms 10ms rustc 1.64.0
java 1-m.java 715ms 68ms 112.9MB 1240ms 53ms openjdk 19
java 1-m.java 816ms 116ms 107.2MB 1427ms 53ms openjdk 20
java 1-m.java 977ms 78ms 302.2MB 1567ms 190ms openjdk/zgc 19

edigits

Input: 250001

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 1.rs 140ms 0.9ms 3.7MB 130ms 0ms rustc 1.64.0
rust 2.rs 575ms 1.8ms 3.7MB 560ms 0ms rustc 1.64.0
java 1-m.java 817ms 50ms 281.2MB 1387ms 120ms graal/jvm 17.0.4
java 1-m.java 822ms 47ms 207.2MB 1430ms 70ms openjdk 19
java 1-m.java 823ms 67ms 221.6MB 1443ms 67ms openjdk 20
java 1-m.java 1036ms 18ms 422.0MB 1453ms 337ms openjdk/zgc 19

Input: 100000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 1.rs 39ms 0.5ms 3.0MB 30ms 0ms rustc 1.64.0
rust 2.rs 112ms 0.5ms 3.1MB 100ms 0ms rustc 1.64.0
java 1-m.java 420ms 13ms 189.2MB 647ms 90ms graal/jvm 17.0.4
java 1-m.java 445ms 7.5ms 116.4MB 717ms 50ms openjdk 19
java 1-m.java 451ms 8.9ms 119.1MB 730ms 53ms openjdk 20
java 1-m.java 565ms 25ms 208.9MB 750ms 180ms openjdk/zgc 19

fannkuch-redux

Input: 11

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 3-im.rs 649ms 0.6ms 0.7MB 1253ms 0ms rustc 1.64.0
rust 2-im.rs 987ms 13ms 0.7MB 1893ms 0ms rustc 1.64.0
rust 3-i.rs 1213ms 9.5ms 0.6MB 1203ms 0ms rustc 1.64.0
rust 5-m.rs 1217ms 22ms 0.7MB 2327ms 0ms rustc 1.64.0
java 1-m.java 1418ms 8.8ms 91.7MB 2653ms 37ms graal/jvm 17.0.4
java 1-m.java 1579ms 40ms 42.2MB 2890ms 80ms openjdk/zgc 19
java 1-m.java 1582ms 75ms 42.1MB 3000ms 13ms openjdk 19
java 1-m.java 1585ms 94ms 44.3MB 3030ms 20ms openjdk 20
rust 2-i.rs 1797ms 0.7ms 0.6MB 1787ms 0ms rustc 1.64.0
rust 1-m.rs 2029ms 11ms 0.7MB 3927ms 0ms rustc 1.64.0
rust 1.rs 3997ms 10ms 0.6MB 3983ms 0ms rustc 1.64.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 3-im.rs 62ms 0.9ms 0.7MB 97ms 0ms rustc 1.64.0
rust 2-im.rs 90ms 2.2ms 0.7MB 150ms 0ms rustc 1.64.0
rust 3-i.rs 103ms 0.5ms 0.6MB 90ms 0ms rustc 1.64.0
rust 5-m.rs 112ms 0.5ms 0.7MB 190ms 0ms rustc 1.64.0
rust 2-i.rs 153ms 0.6ms 0.6MB 140ms 0ms rustc 1.64.0
rust 1-m.rs 182ms 1.3ms 0.7MB 320ms 0ms rustc 1.64.0
java 1-m.java 263ms 5.7ms 42.2MB 420ms 10ms openjdk 19
java 1-m.java 264ms 8.7ms 44.1MB 410ms 23ms openjdk 20
java 1-m.java 292ms 38ms 100.0MB 440ms 37ms graal/jvm 17.0.4
java 1-m.java 317ms 7.1ms 44.0MB 403ms 77ms openjdk/zgc 19
rust 1.rs 337ms 1.1ms 0.6MB 327ms 0ms rustc 1.64.0

http-server

Input: 3000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 2-http2.rs 363ms 82ms 50.3MB 463ms 123ms rustc 1.64.0
rust 2-m.rs 556ms 4.6ms 112.8MB 313ms 553ms rustc 1.64.0
rust 1-http2.rs 1074ms 262ms 88.0MB 1423ms 480ms rustc 1.64.0
rust 1.rs timeout 0.0ms 0.0MB 0ms 0ms rustc 1.64.0

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 1.rs 79ms 20ms 16.7MB 27ms 27ms rustc 1.64.0
rust 2.rs 138ms 6.4ms 30.6MB 43ms 97ms rustc 1.64.0
rust 1-http2.rs 358ms 54ms 28.3MB 500ms 103ms rustc 1.64.0
rust 2-http2.rs timeout 0.0ms 0.0MB 0ms 0ms rustc 1.64.0

json-serde

Input: sample 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 3.rs 84ms 1.6ms 36.4MB 57ms 13ms rustc 1.64.0
rust 2.rs 85ms 0.4ms 38.1MB 57ms 10ms rustc 1.64.0
rust 1.rs 147ms 0.9ms 75.5MB 103ms 27ms rustc 1.64.0

Input: canada 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 3.rs 518ms 0.9ms 258.6MB 397ms 107ms rustc 1.64.0
rust 2.rs 533ms 0.2ms 258.5MB 403ms 113ms rustc 1.64.0
rust 1.rs 954ms 2.4ms 605.5MB 663ms 273ms rustc 1.64.0

knucleotide

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 8-m.rs 353ms 13ms 28.7MB 630ms 13ms rustc 1.64.0
rust 8.rs 636ms 5.3ms 24.0MB 610ms 10ms rustc 1.64.0
java 3-m.java 1499ms 3.9ms 116.2MB 2733ms 37ms openjdk 19
java 3-m.java 1513ms 13ms 114.9MB 2747ms 47ms openjdk 20
java 3-m.java 1537ms 13ms 192.2MB 2767ms 93ms graal/jvm 17.0.4
java 3-m.java 2015ms 5.0ms 174.5MB 3473ms 177ms openjdk/zgc 19

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 8-m.rs 52ms 4.6ms 16.1MB 63ms 10ms rustc 1.64.0
rust 8.rs 81ms 2.7ms 11.5MB 67ms 0ms rustc 1.64.0
java 3-m.java 429ms 5.9ms 92.9MB 690ms 33ms openjdk 20
java 3-m.java 503ms 8.8ms 94.1MB 727ms 100ms openjdk/zgc 19
java 3-m.java 508ms 64ms 96.7MB 820ms 50ms openjdk 19
java 3-m.java 739ms 144ms 179.8MB 1260ms 90ms graal/jvm 17.0.4

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 0-unsafe.rs 53ms 0.9ms 0.6MB 50ms 0ms rustc 1.64.0
rust 1.rs 83ms 5.1ms 2.2MB 73ms 0ms rustc 1.64.0

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 0-unsafe.rs 208ms 10ms 0.6MB 197ms 0ms rustc 1.64.0
rust 1.rs 300ms 24ms 2.1MB 287ms 0ms rustc 1.64.0

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 0-unsafe.rs 32ms 0.8ms 0.6MB 20ms 0ms rustc 1.64.0
rust 1.rs 45ms 0.5ms 0.6MB 37ms 0ms rustc 1.64.0

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 1.java 575ms 8.1ms 294.1MB 597ms 87ms openjdk 20
java 1.java 600ms 16ms 365.9MB 607ms 97ms openjdk 19
java 1.java 681ms 58ms 366.4MB 847ms 120ms graal/jvm 17.0.4
rust 1.rs 894ms 6.7ms 33.8MB 863ms 13ms rustc 1.64.0
java 1.java 1088ms 1.8ms 733.5MB 740ms 500ms openjdk/zgc 19

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 1.rs 186ms 1.2ms 9.8MB 170ms 0ms rustc 1.64.0
java 1.java 245ms 3.0ms 174.2MB 243ms 63ms openjdk 19
java 1.java 246ms 3.9ms 173.9MB 263ms 43ms openjdk 20
java 1-m.java 301ms 4.0ms 244.5MB 420ms 77ms graal/jvm 17.0.4
java 1.java 465ms 8.9ms 325.2MB 287ms 230ms openjdk/zgc 19

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 2.rs 461ms 0.5ms 6.7MB 447ms 0ms rustc 1.64.0
java 2.java 1037ms 6.0ms 53.9MB 1073ms 20ms openjdk 20
java 2.java 1075ms 26ms 54.2MB 1107ms 23ms openjdk 19
java 2.java 1123ms 1.7ms 51.0MB 1100ms 70ms openjdk/zgc 19
java 1.java 1127ms 18ms 86.7MB 1147ms 33ms openjdk 20
java 1.java 1140ms 16ms 84.6MB 1163ms 30ms openjdk 19
rust 1.rs 1352ms 162ms 40.9MB 1327ms 7ms rustc 1.64.0
java 1.java 1405ms 18ms 110.5MB 1353ms 103ms openjdk/zgc 19
java 1.java 1613ms 33ms 164.5MB 2260ms 73ms graal/jvm 17.0.4
java 2-m.java 2068ms 15ms 130.4MB 3833ms 50ms graal/jvm 17.0.4

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 2.rs 105ms 0.7ms 3.1MB 90ms 0ms rustc 1.64.0
rust 1.rs 123ms 2.3ms 11.6MB 107ms 0ms rustc 1.64.0
java 1.java 248ms 2.6ms 60.4MB 283ms 17ms openjdk 20
java 1.java 250ms 2.8ms 62.3MB 283ms 17ms openjdk 19
java 1.java 313ms 4.1ms 59.2MB 283ms 73ms openjdk/zgc 19
java 2.java 329ms 2.4ms 48.7MB 363ms 20ms openjdk 19
java 2.java 330ms 3.1ms 46.8MB 360ms 20ms openjdk 20
java 1-m.java 351ms 14ms 135.8MB 467ms 67ms graal/jvm 17.0.4
java 2.java 388ms 3.1ms 46.1MB 357ms 77ms openjdk/zgc 19
java 2-m.java 669ms 8.9ms 127.2MB 1167ms 67ms graal/jvm 17.0.4

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 1.rs 1738ms 3.3ms 2.8MB 1573ms 150ms rustc 1.64.0
rust 2.rs 1805ms 1.0ms 2.7MB 1737ms 43ms rustc 1.64.0
java 1.java timeout 0.0ms 0.0MB 0ms 0ms 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
rust 1.rs 374ms 0.9ms 2.4MB 357ms 3ms rustc 1.64.0
rust 2.rs 409ms 0.3ms 2.6MB 397ms 0ms rustc 1.64.0
java 1.java 1515ms 17ms 317.7MB 1813ms 113ms openjdk 19
java 1.java 1529ms 15ms 309.2MB 1803ms 107ms openjdk 20
java 1.java 1564ms 6.5ms 384.4MB 1910ms 120ms graal/jvm 17.0.4
java 1.java 2102ms 48ms 967.5MB 1730ms 713ms openjdk/zgc 19

regex-redux

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 7.rs 566ms 0.2ms 77.9MB 743ms 20ms rustc 1.64.0
java 3.java timeout 0.0ms 0.0MB 0ms 0ms graal/jvm 17.0.4
java 3.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 19
java 3.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 20
java 3.java timeout 0.0ms 0.0MB 0ms 0ms openjdk/zgc 19

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 7.rs 63ms 0.6ms 11.2MB 70ms 0ms rustc 1.64.0
java 3.java 1005ms 4.4ms 109.9MB 1327ms 43ms openjdk 19
java 3.java 1009ms 12ms 113.9MB 1327ms 47ms openjdk 20
java 3.java 1023ms 47ms 189.9MB 1433ms 70ms graal/jvm 17.0.4
java 3.java 1145ms 36ms 159.8MB 1283ms 163ms openjdk/zgc 19

secp256k1

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 0.rs 135ms 0.4ms 0.6MB 130ms 0ms rustc 1.64.0
rust 1.rs 1855ms 6.0ms 0.6MB 1843ms 0ms rustc 1.64.0

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 0.rs 36ms 0.5ms 0.6MB 27ms 0ms rustc 1.64.0
rust 1.rs 466ms 0.4ms 0.7MB 453ms 0ms rustc 1.64.0