The Computer Language
Benchmarks Game

Rust programs versus Java

by benchmark task performance

regex-redux
source secs mem gz cpu cpu load
Rust 2.83 179,428 804 4.22 88% 17% 17% 29%
Java 12.31 902,528 929 38.75 73% 76% 86% 81%
mandelbrot
source secs mem gz cpu cpu load
Rust 1.93 52,796 1160 7.65 100% 99% 100% 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 268,344 1324 0.61 34% 100% 31% 28%
Java 1.10 345,352 1661 2.40 33% 82% 53% 54%
binary-trees
source secs mem gz cpu cpu load
Rust 4.43 196,468 717 16.56 92% 92% 100% 93%
Java 11.26 593,156 835 39.02 85% 88% 90% 88%
spectral-norm
source secs mem gz cpu cpu load
Rust 2.34 20,064 817 9.27 100% 100% 100% 100%
Java 4.29 29,884 950 16.56 96% 97% 99% 95%
pidigits
source secs mem gz cpu cpu load
Rust 1.74 7,892 1420 1.74 0% 1% 100% 2%
Java 3.06 31,760 938 3.16 6% 3% 97% 1%
n-body
source secs mem gz cpu cpu load
Rust 13.08 5,704 1540 13.08 0% 1% 1% 100%
Java 21.54 27,092 1489 21.56 1% 1% 100% 1%
k-nucleotide
source secs mem gz cpu cpu load
Rust 5.27 156,408 1728 17.06 77% 91% 68% 91%
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 83% 76% 76% 75%
Java 2.13 36,036 2457 5.66 94% 58% 59% 60%
fannkuch-redux
source secs mem gz cpu cpu load
Rust 10.82 18,084 1020 42.18 99% 100% 93% 98%
Java 13.74 30,368 1282 54.12 100% 98% 98% 99%
Rust

rustc 1.18.0 (03fc9d622 2017-06-06)

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)