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 202,448 765 3.97 64% 20% 57% 18%
Java 10.43 609,920 929 31.73 72% 78% 72% 83%
mandelbrot
source secs mem gz cpu cpu load
Rust 1.75 34,164 1332 6.87 98% 98% 98% 100%
Java 6.13 76,876 796 23.60 96% 96% 96% 97%
reverse-complement
source secs mem gz cpu cpu load
Rust 1.62 995,104 1376 2.75 24% 25% 100% 25%
Java 3.18 672,272 2183 7.17 67% 46% 43% 77%
binary-trees
source secs mem gz cpu cpu load
Rust 4.31 164,868 721 15.85 90% 90% 100% 90%
Java 8.29 930,040 835 28.13 78% 94% 85% 86%
spectral-norm
source secs mem gz cpu cpu load
Rust 2.31 2,516 817 9.18 100% 100% 100% 100%
Java 4.41 35,028 950 16.79 96% 97% 98% 95%
fannkuch-redux
source secs mem gz cpu cpu load
Rust 9.44 1,740 1020 36.95 93% 100% 99% 100%
Java 17.74 31,900 1282 69.78 99% 98% 99% 98%
pidigits
source secs mem gz cpu cpu load
Rust 1.74 4,620 1366 1.74 100% 2% 0% 1%
Java 3.14 37,080 938 3.35 4% 4% 1% 98%
n-body
source secs mem gz cpu cpu load
Rust 13.13 1,740 1805 13.12 1% 100% 0% 1%
Java 22.19 33,272 1489 22.28 35% 2% 66% 1%
fasta
source secs mem gz cpu cpu load
Rust 1.47 3,024 1906 4.54 76% 77% 76% 83%
Java 2.29 43,724 2473 6.16 67% 76% 59% 70%
k-nucleotide
source secs mem gz cpu cpu load
Rust 5.76 135,728 1900 16.77 84% 94% 49% 65%
Java 8.66 384,756 1812 26.91 69% 88% 81% 75%
Rust

rustc 1.28.0 (9634041f0 2018-07-30)

Java

java version "10.0.1" 2018-04-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)