The Computer Language
Benchmarks Game

Rust programs versus Java

by benchmark task performance

reverse-complement
source secs mem gz cpu cpu load
Rust 0.42 250,836 1376 0.70 24% 32% 95% 24%
Java 1.03 191,064 2183 2.31 52% 57% 43% 74%
mandelbrot
source secs mem gz cpu cpu load
Rust 2.78 34,856 1332 10.96 99% 100% 99% 99%
Java 6.04 76,528 796 23.34 98% 97% 97% 97%
binary-trees
source secs mem gz cpu cpu load
Rust 4.37 178,280 721 15.88 89% 90% 99% 88%
Java 8.34 893,008 835 28.20 87% 79% 96% 81%
spectral-norm
source secs mem gz cpu cpu load
Rust 2.35 2,632 817 9.37 100% 100% 100% 100%
Java 4.23 34,472 950 16.27 96% 97% 97% 96%
pidigits
source secs mem gz cpu cpu load
Rust 1.74 4,608 1366 1.74 100% 1% 1% 3%
Java 3.12 36,788 938 3.31 6% 3% 4% 96%
fannkuch-redux
source secs mem gz cpu cpu load
Rust 10.96 1,748 1020 42.90 99% 100% 99% 93%
Java 17.26 32,116 1282 67.75 98% 99% 97% 99%
k-nucleotide
source secs mem gz cpu cpu load
Rust 5.61 138,052 1647 16.38 81% 100% 49% 63%
Java 8.70 375,568 1812 27.17 80% 72% 74% 88%
n-body
source secs mem gz cpu cpu load
Rust 14.32 1,748 1805 14.32 100% 1% 1% 0%
Java 22.10 33,136 1429 22.20 31% 1% 1% 70%
fasta
source secs mem gz cpu cpu load
Rust 2.05 3,276 1906 5.06 59% 71% 59% 59%
Java 2.33 43,924 2473 6.07 53% 71% 63% 74%
regex-redux
source secs mem gz cpu cpu load
Rust   Make Error
Java 0.62 45,052 929 1.84 86% 66% 72% 75%
Rust

rustc 1.24.0 (4d90ac38c 2018-02-12)

Java

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