The Computer Language
Benchmarks Game

Rust versus Java fastest programs

by faster benchmark performance

regex-redux
source secs mem gz cpu cpu load
Rust 2.44 205,624 765 3.86 11% 91% 0% 59%
Java 10.50 571,736 929 31.63 71% 73% 66% 92%
mandelbrot
source secs mem gz cpu cpu load
Rust 1.75 33,800 1332 6.86 98% 98% 100% 98%
Java 6.96 76,316 796 27.06 97% 97% 97% 97%
spectral-norm
source secs mem gz cpu cpu load
Rust 1.98 2,460 1126 7.87 100% 99% 99% 99%
Java 4.26 33,572 950 16.39 96% 96% 98% 95%
reverse-complement
source secs mem gz cpu cpu load
Rust 1.61 995,072 1376 2.71 24% 31% 95% 24%
Java 3.32 609,712 2183 7.54 64% 44% 44% 76%
binary-trees
source secs mem gz cpu cpu load
Rust 4.11 175,320 721 15.08 100% 90% 90% 90%
Java 8.39 960,056 835 27.39 81% 85% 74% 90%
pidigits
source secs mem gz cpu cpu load
Rust 1.74 4,412 1366 1.74 1% 100% 1% 1%
Java 3.13 37,376 938 3.35 1% 98% 4% 6%
fannkuch-redux
source secs mem gz cpu cpu load
Rust 10.01 1,864 1020 39.03 100% 92% 99% 100%
Java 17.98 31,180 1282 70.57 97% 99% 97% 99%
n-body
source secs mem gz cpu cpu load
Rust 13.27 1,796 1805 13.26 0% 1% 1% 100%
Java 22.00 32,272 1489 22.07 1% 0% 0% 100%
k-nucleotide
source secs mem gz cpu cpu load
Rust 5.41 137,908 1749 17.41 77% 89% 57% 100%
Java 8.74 470,116 1812 27.12 71% 73% 93% 74%
fasta
source secs mem gz cpu cpu load
Rust 1.47 3,032 1906 4.97 83% 84% 83% 90%
Java 2.32 42,212 2473 6.30 65% 85% 47% 76%
Rust

rustc 1.31.0 (abe02cefd 2018-12-04)
LLVM version 7.0.0

Java

openjdk 11 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)