The Computer Language
Benchmarks Game

Rust programs versus Java

by benchmark task performance

regex-redux
source secs mem gz cpu cpu load
Rust 3.05 188,644 804 4.48 31% 17% 85% 16%
Java 10.34 627,224 929 29.88 74% 72% 65% 79%
mandelbrot
source secs mem gz cpu cpu load
Rust 1.97 13,340 1007 7.86 99% 99% 100% 100%
Java 6.04 76,528 796 23.34 98% 97% 97% 97%
reverse-complement
source secs mem gz cpu cpu load
Rust 0.37 250,784 1376 0.66 29% 29% 100% 28%
Java 1.03 191,064 2183 2.31 52% 57% 43% 74%
binary-trees
source secs mem gz cpu cpu load
Rust 4.02 167,776 721 14.63 89% 99% 91% 89%
Java 8.34 893,008 835 28.20 87% 79% 96% 81%
spectral-norm
source secs mem gz cpu cpu load
Rust 2.27 2,624 817 9.00 100% 99% 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,612 1366 1.74 2% 0% 0% 99%
Java 3.12 36,788 938 3.31 6% 3% 4% 96%
k-nucleotide
source secs mem gz cpu cpu load
Rust 5.06 137,864 1748 15.66 54% 97% 71% 89%
Java 8.70 375,568 1812 27.17 80% 72% 74% 88%
fannkuch-redux
source secs mem gz cpu cpu load
Rust 10.59 1,776 1020 41.71 100% 99% 100% 95%
Java 17.26 32,116 1282 67.75 98% 99% 97% 99%
n-body
source secs mem gz cpu cpu load
Rust 13.57 1,768 1480 13.57 100% 0% 0% 1%
Java 22.10 33,136 1429 22.20 31% 1% 1% 70%
fasta
source secs mem gz cpu cpu load
Rust 1.47 2,988 1906 4.55 83% 76% 76% 76%
Java 2.33 43,924 2473 6.07 53% 71% 63% 74%
Rust

rustc 1.23.0 (766bd11c8 2018-01-01)

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)