vs

 1 : Are the Rust programs faster? At a glance.

Each chart bar shows, for one unidentified benchmark, how much the fastest Rust program used compared to the fastest C++ g++ program.

(Memory use is only compared for tasks that require memory to be allocated.)


These are not the only compilers and interpreters. These are not the only programs that could be written. These are not the only tasks that could be solved. These are just 10 tiny examples.

 2 : Are the Rust programs faster? Approximately.

Each table row shows, for one named benchmark, how much the fastest Rust program used compared to the fastest C++ g++ program.

(Memory use is only compared for tasks that require memory to be allocated.)

 Rust used what fraction? used how many times more? 
Benchmark Time Memory Code
 binary-trees±1/2±
 fannkuch-redux± 1/2
 n-body ±
 regex-dna±±
 spectral-norm † 1/2
 pidigits ±
 reverse-complement †156×1/21/5
 Rust used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)±±14×156×

† possible mismatch - one-core program compared to multi-core program.

± read the measurements and then read the program source code.

 3 : Are the Rust programs faster? Measurements.

These are not the only tasks that could be solved. These are just 10 tiny examples. These are not the only compilers and interpreters. These are not the only programs that could be written.

For each named benchmark, measurements of the fastest Rust program are shown for comparison against measurements of the fastest C++ g++ program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
 binary-trees 
Rust22.716.25229,028788  96% 86% 92% 92%
C++ g++27.048.03357,812892  58% 97% 91% 94%
 fannkuch-redux 
Rust71.7817.9939,844644  100% 100% 100% 100%
C++ g++53.3313.631,2641440  100% 98% 99% 94%
 n-body 
Rust21.3321.344,7841371  1% 100% 0% 0%
C++ g++9.359.354321544  98% 1% 3% 1%
 regex-dna 
Rust41.9915.23228,400878  59% 79% 80% 59%
C++ g++5.273.55198,920695  9% 49% 69% 26%
 spectral-norm 
Rust15.6915.694,788525  0% 1% 100% 0% †
C++ g++10.092.544961044  99% 99% 100% 100% †
 pidigits 
Rust16.6716.684,512691  1% 100% 0% 0%
C++ g++2.292.301,656682  1% 0% 0% 100%
 reverse-complement 
Rust100.89100.93131,840433  1% 0% 100% 0% †
C++ g++1.020.65247,5082275  17% 64% 34% 48% †
 fasta-redux 
No program
C++ g++0.030.03?1474  0% 0% 100% 25%
 fasta 
No program
C++ g++0.050.05?1286  0% 0% 100% 0%
 k-nucleotide 
No program
C++ g++0.760.385681252  89% 38% 43% 35%
 mandelbrot 
RustBad Output
C++ g++0.110.03?1017  75% 75% 100% 75%

† possible mismatch - one-core program compared to multi-core program.

 4 : Are there other Rust programs for these benchmarks?

Remember - those are just the fastest Rust and C++ g++ programs measured on this OS/machine. Check if there are other implementations of these benchmark programs for Rust.

Maybe one of those other Rust programs is fastest on a different OS/machine.

 5 : Are there other faster programs for these benchmarks?

Remember - those are just the fastest Rust and C++ g++ programs measured on this OS/machine. Check if there are faster implementations of these benchmark programs for other programming languages.

Maybe one of those other programs is fastest on a different OS/machine.

 Rust : large-system integrity availability and concurrency 

rustc 0.11.0 (aa1163b92de7717eb7c5eba002b4012e0574a7fe 2014-06-27 12:50:16 -0700)

Home Page: Rust a safe, concurrent, practical language

Revised BSD license

  Home   Conclusions   License   Play