The Computer Language
Benchmarks Game

Rust programs versus Java

by benchmark task performance

regex-redux
source secs mem gz cpu cpu load
Rust 2.70 173,336 804 4.24 20% 33% 88% 20%
Java 12.31 902,528 929 38.75 73% 76% 86% 81%
mandelbrot
source secs mem gz cpu cpu load
Rust 1.89 52,740 1160 7.47 100% 99% 99% 99%
Java 7.10 90,588 796 27.92 99% 99% 98% 98%
reverse-complement
source secs mem gz cpu cpu load
Rust 0.33 270,356 1324 0.61 30% 100% 35% 33%
Java 1.10 345,352 1661 2.40 33% 82% 53% 54%
binary-trees
source secs mem gz cpu cpu load
Rust 4.33 194,824 717 15.92 100% 91% 91% 92%
Java 11.26 593,156 835 39.02 85% 88% 90% 88%
pidigits
source secs mem gz cpu cpu load
Rust 1.74 7,820 1420 1.74 1% 0% 1% 100%
Java 3.06 31,760 938 3.16 6% 3% 97% 1%
spectral-norm
source secs mem gz cpu cpu load
Rust 2.50 13,956 1050 9.33 95% 93% 90% 97%
Java 4.29 29,884 950 16.56 96% 97% 99% 95%
n-body
source secs mem gz cpu cpu load
Rust 13.08 5,772 1540 13.08 1% 100% 1% 2%
Java 21.54 27,092 1489 21.56 1% 1% 100% 1%
k-nucleotide
source secs mem gz cpu cpu load
Rust 5.27 158,224 1728 16.66 99% 58% 91% 71%
Java 7.93 465,372 1802 25.11 75% 75% 75% 93%
fasta
source secs mem gz cpu cpu load
Rust 1.48 18,524 1887 4.56 82% 76% 75% 76%
Java 2.13 36,036 2457 5.66 94% 58% 59% 60%
fannkuch-redux
source secs mem gz cpu cpu load
Rust 10.74 20,056 1020 42.08 100% 99% 94% 100%
Java 13.74 30,368 1282 54.12 100% 98% 98% 99%
Rust

rustc 1.17.0 (56124baa9 2017-04-24)

Java

java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)