The Computer Language
Benchmarks Game

Rust programs versus Java

by benchmark task performance

regex-redux
source secs mem gz cpu cpu load
Rust 3.00 196,176 804 4.38 85% 16% 30% 16%
Java 10.34 627,224 929 29.88 74% 72% 65% 79%
mandelbrot
source secs mem gz cpu cpu load
Rust 2.02 34,644 1332 8.00 99% 99% 100% 99%
Java 6.04 76,528 796 23.34 98% 97% 97% 97%
reverse-complement
source secs mem gz cpu cpu load
Rust 0.36 250,724 1376 0.65 26% 95% 35% 27%
Java 1.03 191,064 2183 2.31 52% 57% 43% 74%
binary-trees
source secs mem gz cpu cpu load
Rust 3.95 171,796 721 14.30 89% 90% 88% 97%
Java 8.34 893,008 835 28.20 87% 79% 96% 81%
spectral-norm
source secs mem gz cpu cpu load
Rust 2.32 2,568 817 9.23 100% 100% 100% 99%
Java 4.23 34,472 950 16.27 96% 97% 97% 96%
pidigits
source secs mem gz cpu cpu load
Rust 1.74 4,420 1366 1.74 100% 1% 0% 1%
Java 3.12 36,788 938 3.31 6% 3% 4% 96%
k-nucleotide
source secs mem gz cpu cpu load
Rust 4.98 137,872 1748 15.58 72% 88% 57% 98%
Java 8.70 375,568 1812 27.17 80% 72% 74% 88%
n-body
source secs mem gz cpu cpu load
Rust 13.57 1,728 1480 13.56 0% 0% 1% 100%
Java 22.10 33,136 1429 22.20 31% 1% 1% 70%
fasta
source secs mem gz cpu cpu load
Rust 1.48 2,980 1906 4.59 76% 78% 78% 83%
Java 2.33 43,924 2473 6.07 53% 71% 63% 74%
fannkuch-redux
source secs mem gz cpu cpu load
Rust 11.04 1,768 1020 43.14 96% 99% 98% 99%
Java 17.26 32,116 1282 67.75 98% 99% 97% 99%
Rust

rustc 1.21.0 (3b72af97e 2017-10-09)

Java

java 9.0.1
Java(TM) SE Runtime Environment (build 9.0.1+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)