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±±±
 fannkuch-redux± 1/2
 n-body ±
 regex-dna±±
 pidigits ±
 spectral-norm †16× 1/2
 reverse-complement †167×1/21/5
 Rust used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)±±12×27×167×

† 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 
Rust15.384.06130,456788  96% 99% 93% 93%
C++ g++15.895.05179,668892  73% 70% 97% 77%
 fannkuch-redux 
Rust70.6217.7137,720644  100% 100% 100% 99%
C++ g++50.0312.881,0361440  99% 99% 100% 99%
 n-body 
Rust26.0926.104,9241371  0% 1% 100% 0%
C++ g++9.089.093361544  0% 100% 1% 0%
 regex-dna 
Rust46.7416.83234,528878  80% 59% 63% 83%
C++ g++5.383.83171,652695  1% 65% 76% 2%
 pidigits 
Rust20.4420.464,496691  0% 0% 1% 100%
C++ g++2.682.681,452682  0% 0% 1% 100%
 spectral-norm 
Rust32.8932.904,676525  0% 0% 100% 1% †
C++ g++7.972.009241044  100% 100% 100% 100% †
 reverse-complement 
Rust124.60124.71129,864433  12% 39% 5% 46% †
C++ g++1.150.75247,0082275  11% 87% 30% 29% †
 fasta 
No program
C++ g++0.050.05?1286  0% 0% 0% 100%
 fasta-redux 
No program
C++ g++0.030.03?1474  0% 0% 25% 100%
 k-nucleotide 
No program
C++ g++0.560.295241252  37% 86% 37% 41%
 mandelbrot 
RustBad Output
C++ g++0.100.03?1017  75% 80% 100% 100%

† 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