The Computer Language
Benchmarks Game

Rust programs versus Java

by benchmark task performance

regex-redux
source secs mem gz cpu cpu load
Rust 2.99 192,244 804 4.36 31% 16% 85% 16%
Java 10.34 627,224 929 29.88 74% 72% 65% 79%
mandelbrot
source secs mem gz cpu cpu load
Rust 2.02 33,572 1332 8.00 99% 100% 99% 99%
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,708 1376 0.66 100% 28% 28% 31%
Java 1.03 191,064 2183 2.31 52% 57% 43% 74%
binary-trees
source secs mem gz cpu cpu load
Rust 3.88 173,136 721 14.24 90% 91% 100% 90%
Java 8.34 893,008 835 28.20 87% 79% 96% 81%
spectral-norm
source secs mem gz cpu cpu load
Rust 1.98 2,580 817 7.90 100% 99% 100% 99%
Java 4.23 34,472 950 16.27 96% 97% 97% 96%
pidigits
source secs mem gz cpu cpu load
Rust 1.74 4,532 1366 1.74 100% 1% 0% 2%
Java 3.12 36,788 938 3.31 6% 3% 4% 96%
k-nucleotide
source secs mem gz cpu cpu load
Rust 4.86 137,656 1748 15.42 57% 100% 75% 88%
Java 8.70 375,568 1812 27.17 80% 72% 74% 88%
fannkuch-redux
source secs mem gz cpu cpu load
Rust 10.57 1,804 1020 41.41 99% 100% 100% 93%
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,756 1480 13.57 0% 1% 1% 100%
Java 22.10 33,136 1429 22.20 31% 1% 1% 70%
fasta
source secs mem gz cpu cpu load
Rust 1.47 2,992 1906 4.58 76% 76% 83% 77%
Java 2.33 43,924 2473 6.07 53% 71% 63% 74%
Rust

rustc 1.22.1 (05e2e1c41 2017-11-22)

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)