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± 
 fannkuch-redux± ±
 binary-trees±±±
 reverse-complement±
 n-body ±
 fasta † 1/2
 regex-dna±1/3
 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.309.40155,7482078  79% 80% 75% 57%
C gcc36.5812.35131,9041535  37% 71% 95% 94%
 pidigits 
Rust2.492.506,7761420  0% 2% 1% 100%
C gcc2.492.502,140448  100% 0% 1% 0%
 fannkuch-redux 
Rust46.6411.9012,2041191  98% 100% 95% 99%
C gcc39.4910.061,388910  99% 99% 95% 100%
 binary-trees 
Rust13.853.6883,316791  98% 94% 94% 92%
C gcc9.682.97105,024906  93% 77% 87% 72%
 reverse-complement 
Rust1.321.06260,0521985  20% 16% 12% 80%
C gcc0.860.60251,368741  95% 84% 44% 15%
 n-body 
Rust24.5724.586,2361474  0% 100% 1% 0%
C gcc10.3810.397361490  0% 100% 1% 1%
 fasta 
Rust5.175.176,1721211  1% 31% 70% 1% †
C gcc5.291.812,3521914  89% 53% 54% 100% †
 regex-dna 
Rust76.2024.37213,116740  72% 99% 72% 71%
C gcc6.342.67290,7922579  96% 76% 84% 67%
 fasta-redux 
No program
C gcc0.020.02?1402  0% 0% 0% 100%
 spectral-norm 
RustMake Error
C gcc0.070.04?569  50% 100% 33% 33%
 mandelbrot 
RustMake Error
C gcc0.110.03?799  100% 67% 67% 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 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.0.0 (a59de37e9 2015-05-13) (built 2015-05-14)

Home Page: Rust a safe, concurrent, practical language

Revised BSD license

  Home   Conclusions   License   Play