The Computer Language
Benchmarks Game

Rust programs versus Java

by benchmark task performance

regex-redux
source secs mem gz cpu cpu load
Rust 2.73 175,372 701 4.24 19% 19% 100% 20%
Java 12.31 902,528 929 38.75 73% 76% 86% 81%
reverse-complement
source secs mem gz cpu cpu load
Rust 0.33 268,384 1324 0.61 100% 36% 31% 31%
Java 1.10 345,352 1661 2.40 33% 82% 53% 54%
binary-trees
source secs mem gz cpu cpu load
Rust 4.66 184,704 717 17.32 92% 91% 91% 100%
Java 11.26 593,156 835 39.02 85% 88% 90% 88%
spectral-norm
source secs mem gz cpu cpu load
Rust 2.44 20,048 817 9.60 98% 99% 98% 99%
Java 4.29 29,884 950 16.56 96% 97% 99% 95%
pidigits
source secs mem gz cpu cpu load
Rust 1.74 7,820 1306 1.74 3% 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 12.82 5,672 1540 12.81 0% 0% 100% 1%
Java 21.54 27,092 1489 21.56 1% 1% 100% 1%
k-nucleotide
source secs mem gz cpu cpu load
Rust 5.40 156,208 1627 16.18 86% 99% 66% 51%
Java 7.93 465,372 1802 25.11 75% 75% 75% 93%
mandelbrot
source secs mem gz cpu cpu load
Rust 4.93 71,144 868 19.48 99% 98% 100% 100%
Java 7.10 90,588 796 27.92 99% 99% 98% 98%
fasta
source secs mem gz cpu cpu load
Rust 1.49 18,592 1887 4.64 77% 84% 76% 76%
Java 2.13 36,036 2457 5.66 94% 58% 59% 60%
fannkuch-redux
source secs mem gz cpu cpu load
Rust 10.99 20,012 1020 43.08 94% 100% 99% 100%
Java 13.74 30,368 1282 54.12 100% 98% 98% 99%
Rust

rustc 1.19.0 (0ade33941 2017-07-17)

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)