The Computer Language
Benchmarks Game

Rust programs versus Java

by benchmark task performance

regex-redux
source secs mem gz cpu cpu load
Rust 3.01 180,660 804 4.41 16% 16% 16% 100%
Java 10.51 573,972 929 31.30 70% 73% 70% 86%
mandelbrot
source secs mem gz cpu cpu load
Rust 1.75 34,132 1332 6.86 98% 100% 98% 98%
Java 6.10 76,520 796 23.59 97% 98% 98% 96%
binary-trees
source secs mem gz cpu cpu load
Rust 4.13 167,624 721 15.17 90% 100% 89% 90%
Java 8.39 933,808 835 28.28 82% 86% 84% 88%
reverse-complement
source secs mem gz cpu cpu load
Rust 1.62 995,084 1376 2.75 100% 24% 26% 24%
Java 3.15 680,424 2183 7.07 52% 70% 43% 63%
spectral-norm
source secs mem gz cpu cpu load
Rust 2.30 2,520 817 9.18 100% 100% 100% 100%
Java 4.38 35,388 950 16.80 96% 96% 95% 97%
fannkuch-redux
source secs mem gz cpu cpu load
Rust 9.60 1,816 1020 37.59 100% 94% 100% 99%
Java 18.27 31,820 1282 72.06 99% 99% 98% 98%
pidigits
source secs mem gz cpu cpu load
Rust 1.74 4,672 1366 1.74 1% 1% 100% 0%
Java 3.13 36,984 938 3.36 4% 4% 99% 3%
n-body
source secs mem gz cpu cpu load
Rust 13.26 1,784 1480 13.25 3% 1% 100% 1%
Java 22.17 33,040 1489 22.27 100% 1% 0% 1%
k-nucleotide
source secs mem gz cpu cpu load
Rust 5.28 137,948 1749 16.08 69% 100% 52% 85%
Java 8.75 385,056 1812 27.09 85% 72% 70% 85%
fasta
source secs mem gz cpu cpu load
Rust 1.47 2,980 1961 4.47 78% 75% 75% 82%
Java 2.27 43,628 2473 5.93 51% 75% 57% 81%
Rust

rustc 1.26.0 (a77568041 2018-05-07)

Java

java 10 2018-03-20
Java(TM) SE Runtime Environment 18.3 (build 10+46)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10+46, mixed mode)