The Computer Language
Benchmarks Game

Rust programs versus Java

by benchmark task performance

regex-redux
source secs mem gz cpu cpu load
Rust 2.81 211,044 804 4.30 19% 100% 18% 19%
Java 10.38 634,548 929 29.48 70% 64% 69% 82%
reverse-complement
source secs mem gz cpu cpu load
Rust 0.33 254,596 1324 0.62 31% 36% 100% 34%
Java 1.13 199,672 2124 2.76 48% 74% 70% 54%
mandelbrot
source secs mem gz cpu cpu load
Rust 2.03 44,720 1332 8.00 99% 100% 99% 99%
Java 6.08 77,056 796 23.61 97% 97% 99% 97%
binary-trees
source secs mem gz cpu cpu load
Rust 3.98 213,448 717 14.66 92% 90% 90% 100%
Java 8.58 966,808 835 28.98 86% 84% 90% 81%
spectral-norm
source secs mem gz cpu cpu load
Rust 2.33 18,048 817 9.26 100% 100% 100% 100%
Java 4.25 36,364 950 16.30 97% 96% 95% 97%
pidigits
source secs mem gz cpu cpu load
Rust 1.74 7,892 1420 1.74 100% 1% 2% 1%
Java 3.12 37,444 938 3.30 2% 5% 98% 4%
n-body
source secs mem gz cpu cpu load
Rust 13.57 5,824 1474 13.56 1% 1% 100% 1%
Java 22.56 35,208 1424 22.65 99% 1% 1% 1%
k-nucleotide
source secs mem gz cpu cpu load
Rust 5.20 155,200 1728 16.14 91% 54% 100% 71%
Java 8.38 375,988 1802 26.25 73% 97% 70% 74%
fasta
source secs mem gz cpu cpu load
Rust 1.48 20,252 1887 4.60 83% 76% 76% 77%
Java 2.32 46,816 2457 6.37 61% 60% 96% 60%
fannkuch-redux
source secs mem gz cpu cpu load
Rust 11.21 20,064 1020 43.78 100% 100% 95% 97%
Java 15.09 34,764 1282 59.26 99% 98% 98% 100%
Rust

rustc 1.21.0 (3b72af97e 2017-10-09)

Java

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