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±
 pidigits± 
 reverse-complement±±±
 spectral-norm± ±
 mandelbrot± ±
 fannkuch-redux± ±
 fasta± ±
 k-nucleotide±±
 n-body ±
 regex-dna±±
 Rust used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)±±±±±

± 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.055.97228,196788  96% 87% 95% 93%
C++ g++27.048.03357,812892  58% 97% 91% 94%
 pidigits 
Rust1.731.735,3081297  1% 100% 0% 0%
C++ g++2.292.301,656682  1% 0% 0% 100%
 reverse-complement 
Rust0.740.49257,1602015  12% 82% 41% 18%
C++ g++1.020.65247,5082275  17% 64% 34% 48%
 spectral-norm 
Rust7.872.065,1121020  95% 96% 96% 96%
C++ g++10.092.544961044  99% 99% 100% 100%
 mandelbrot 
Rust20.145.0956,8241290  98% 99% 100% 99%
C++ g++23.775.9732,3881017  100% 100% 100% 100%
 fannkuch-redux 
Rust50.0112.817,0721180  99% 100% 97% 95%
C++ g++53.3313.631,2641440  100% 98% 99% 94%
 fasta 
Rust4.995.004,8121224  1% 0% 100% 0%
C++ g++4.234.231,0721286  1% 95% 1% 5%
 k-nucleotide 
Rust26.069.76152,5362113  42% 83% 43% 99%
C++ g++24.797.34154,7841252  81% 80% 81% 97%
 n-body 
Rust20.9920.994,8241371  1% 0% 0% 100%
C++ g++9.359.354321544  98% 1% 3% 1%
 regex-dna 
Rust35.2611.95228,296763  65% 66% 87% 78%
C++ g++5.273.55198,920695  9% 49% 69% 26%
 fasta-redux 
No program
C++ g++0.030.03?1474  0% 0% 100% 25%

 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.12.0 (ba4081a5a 2014-10-07 13:44:41 -0700)

Home Page: Rust a safe, concurrent, practical language

Revised BSD license

  Home   Conclusions   License   Play