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

Each chart bar shows, for one unidentified benchmark, how much the fastest Rust program used compared to the fastest C gcc 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 : Approximately - Are the Rust programs faster?

Each table row shows, for one named benchmark, how much the fastest Rust program used compared to the fastest C gcc 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
 k-nucleotide±±±
 pidigits± 
 regex-dna±1/21/4
 mandelbrot± ±
 fannkuch-redux± ±
 binary-trees±±±
 reverse-complement±
 n-body ±
 fasta † 1/2
 Rust used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)±±±±

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

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

 3 : Measurements - Are the Rust programs faster?

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 gcc program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
 k-nucleotide 
Rust27.669.47155,5802078  99% 57% 80% 57%
C gcc36.5812.35131,9041535  37% 71% 95% 94%
 pidigits 
Rust2.492.496,6641420  1% 2% 100% 1%
C gcc2.492.502,140448  100% 0% 1% 0%
 regex-dna 
Rust3.832.85180,800669  12% 100% 12% 12%
C gcc6.342.67290,7922579  96% 76% 84% 67%
 mandelbrot 
Rust25.656.4959,6081080  100% 100% 100% 98%
C gcc22.405.6128,988799  100% 100% 100% 100%
 fannkuch-redux 
Rust46.8011.9312,0881191  96% 98% 100% 99%
C gcc39.4910.061,388910  99% 99% 95% 100%
 binary-trees 
Rust13.703.6580,188791  89% 96% 95% 99%
C gcc9.682.97105,024906  93% 77% 87% 72%
 reverse-complement 
Rust1.291.08260,0641985  14% 7% 19% 81%
C gcc0.860.60251,368741  95% 84% 44% 15%
 n-body 
Rust24.5724.586,0241474  100% 0% 0% 1%
C gcc10.3810.397361490  0% 100% 1% 1%
 fasta 
Rust5.205.216,1161211  0% 0% 1% 100% †
C gcc5.291.812,3521914  89% 53% 54% 100% †
 spectral-norm 
RustMake Error
C gcc0.070.04?569  50% 100% 33% 33%
 fasta-redux 
No program
C gcc0.020.02?1402  0% 0% 0% 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 gcc 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 gcc 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 1.1.0 (35ceea399 2015-06-19)

Home Page: Rust a safe, concurrent, practical language

Revised BSD license

  Home   Conclusions   License   Play