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

± 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
 reverse-complement 
Rust0.610.62257,0562015  2% 5% 3% 100%
C++ g++0.980.99245,6922275  3% 1% 0% 99%
 mandelbrot 
Rust20.5120.5237,4681290  1% 1% 0% 100%
C++ g++23.4423.4532,1801017  0% 1% 1% 100%
 pidigits 
Rust2.502.505,1881297  1% 1% 2% 100%
C++ g++2.682.681,452682  0% 1% 4% 100%
 k-nucleotide 
Rust27.7327.75148,2842113  1% 1% 0% 100%
C++ g++24.0324.04138,9601252  1% 1% 0% 100%
 fasta 
Rust4.974.984,6761224  1% 0% 0% 100%
C++ g++4.224.228721286  1% 1% 0% 100%
 binary-trees 
Rust14.1714.19130,104788  1% 1% 0% 100%
C++ g++10.9210.94148,508892  1% 1% 0% 100%
 fannkuch-redux 
Rust48.6248.646,9161180  1% 1% 0% 100%
C++ g++27.2227.232841150  0% 1% 1% 100%
 spectral-norm 
Rust15.7115.714,784485  1% 0% 0% 100%
C++ g++7.927.939241044  0% 1% 1% 100%
 n-body 
Rust21.8921.904,6801371  1% 0% 0% 100%
C++ g++9.089.083361544  0% 0% 1% 100%
 regex-dna 
Rust41.8441.87219,988763  1% 0% 0% 100%
C++ g++5.335.34170,488695  0% 0% 1% 100%
 fasta-redux 
No program
C++ g++0.020.03?1474  0% 0% 0% 100%

 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