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.54 204,160 765 3.95 55% 30% 56% 18%
Java 10.52 637,380 929 31.89 75% 80% 77% 72%
mandelbrot
source secs mem gz cpu cpu load
Rust 1.75 34,176 1332 6.86 98% 98% 100% 98%
Java 6.96 76,748 796 27.07 98% 98% 96% 98%
spectral-norm
source secs mem gz cpu cpu load
Rust 1.98 2,472 1126 7.86 100% 100% 99% 100%
Java 4.27 32,960 950 16.41 95% 97% 98% 96%
binary-trees
source secs mem gz cpu cpu load
Rust 3.98 165,920 721 14.61 90% 100% 90% 89%
Java 8.28 982,224 835 27.19 79% 86% 83% 83%
reverse-complement
source secs mem gz cpu cpu load
Rust 1.61 995,100 1376 2.72 25% 81% 39% 28%
Java 3.31 626,956 2183 7.44 56% 60% 83% 45%
fannkuch-redux
source secs mem gz cpu cpu load
Rust 9.60 1,752 1020 37.68 100% 96% 99% 99%
Java 17.91 31,560 1282 70.25 99% 98% 99% 97%
pidigits
source secs mem gz cpu cpu load
Rust 1.74 4,488 1366 1.74 1% 100% 1% 0%
Java 3.13 37,324 938 3.35 98% 5% 3% 3%
n-body
source secs mem gz cpu cpu load
Rust 13.31 1,768 1805 13.31 0% 0% 1% 100%
Java 22.00 32,496 1489 22.07 1% 100% 0% 1%
k-nucleotide
source secs mem gz cpu cpu load
Rust 5.34 138,504 1749 17.16 87% 100% 78% 58%
Java 8.66 385,768 1812 26.52 76% 81% 74% 76%
fasta
source secs mem gz cpu cpu load
Rust 1.47 2,988 1906 4.97 88% 83% 90% 84%
Java 2.32 42,556 2473 6.24 73% 85% 49% 63%
Rust

rustc 1.29.0 (aa3ca1994 2018-09-11)
LLVM version 5.0.1

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)