The Computer Language
Benchmarks Game

Rust programs versus Java

by benchmark task performance

regex-redux
source secs mem gz cpu cpu load
Rust 3.28 222,916 804 6.46 33% 100% 32% 35%
Java 12.16 927,212 929 37.28 73% 81% 75% 78%
mandelbrot
source secs mem gz cpu cpu load
Rust 1.90 38,724 1160 7.48 98% 98% 99% 98%
Java 5.89 89,504 796 23.08 98% 98% 98% 99%
binary-trees
source secs mem gz cpu cpu load
Rust 4.27 184,600 714 15.84 98% 92% 92% 92%
Java 11.33 592,668 835 39.39 84% 92% 83% 91%
reverse-complement
source secs mem gz cpu cpu load
Rust 0.45 254,232 1324 0.76 25% 26% 28% 98%
Java 1.11 345,308 1661 2.44 33% 58% 54% 80%
spectral-norm
source secs mem gz cpu cpu load
Rust 2.36 14,036 1050 9.04 99% 99% 99% 99%
Java 4.29 31,428 950 16.56 97% 96% 98% 97%
pidigits
source secs mem gz cpu cpu load
Rust 1.75 6,280 1306 1.74 2% 1% 1% 100%
Java 3.06 31,088 938 3.16 0% 3% 9% 92%
n-body
source secs mem gz cpu cpu load
Rust 13.08 3,676 1799 13.08 1% 1% 100% 1%
Java 21.50 27,240 1489 21.52 1% 1% 100% 0%
fannkuch-redux
source secs mem gz cpu cpu load
Rust 10.80 20,028 1020 43.07 100% 100% 100% 100%
Java 17.74 30,048 1282 69.90 98% 98% 100% 99%
k-nucleotide
source secs mem gz cpu cpu load
Rust 5.30 140,364 1728 16.34 100% 86% 55% 70%
Java 8.02 467,004 1802 25.57 76% 98% 73% 74%
fasta
source secs mem gz cpu cpu load
Rust 1.49 20,324 1887 4.55 75% 76% 75% 82%
Java 2.14 36,192 2457 5.68 71% 58% 62% 77%
Rust

rustc 1.16.0 (30cf806ef 2017-03-10)

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)