language-bench

C

C compiled ahead-of-time by GCC. The classic performance baseline: no runtime, no garbage collector, manual memory management.

gcc.gnu.org ↗
Overall speed rank
#1 of 3
1.00× the fastest language
Latest release
16
12 tracked releases since 2015
Strongest on
Hash map
1.00× vs the fastest
Weakest on
Sorting
1.66× vs the fastest

Performance by problem

Newest release (16), default build (gcc -O3 -march=native). The index is how many times slower this language is than the fastest entry on that problem (1.00× = fastest); rank is among all languages.

ProblemTimevs fastestRankMemory
Binary Trees60.2 ms1.16×
#2 / 32.5 MB
Fannkuch-redux18.7 ms1.02×
#10.4 MB
File processing146 ms1.01×
#11.4 MB
Hash map31.0 ms1.00×
#120.5 MB
JSON parsing19.6 ms1.00×
#120.4 MB
Matrix multiply2.0 ms1.06×
#13.2 MB
N-Body simulation64.1 ms1.01×
#10.4 MB
Parallel reduction105 ms1.12×
#2 / 30.5 MB
Prime sieve21.4 ms1.07×
#2 / 310.4 MB
Sorting267 ms1.66×
#2 / 316.2 MB
String operations16.6 ms1.02×
#113.8 MB

Compare with other languages

How fast each language is relative to C (composite over all tasks).

Go
1.8× slower
Python
18× slower

Build settings

gcc -O3 -march=native default

Maximum optimisation for the CPU the benchmark runs on (ties results to that CPU's instruction set).

gcc -O3 -march=native -ffp-contract=off -o {bin} {harness}/harness.c {src}/main.c -lm -lpthread{bin}

gcc -O3

Portable x86-64 baseline, no CPU-specific instructions.

gcc -O3 -ffp-contract=off -o {bin} {harness}/harness.c {src}/main.c -lm -lpthread{bin}

gcc -O2

The most common release optimisation level.

gcc -O2 -ffp-contract=off -o {bin} {harness}/harness.c {src}/main.c -lm -lpthread{bin}

Every release (default build)

ReleaseBinary TreesFannkuch-reduxFile processingHash mapJSON parsingMatrix multiplyN-Body simulationParallel reductionPrime sieveSortingString operations
16 2026-04-3060.2 ms18.7 ms146 ms31.0 ms19.6 ms2.0 ms64.1 ms105 ms21.4 ms267 ms16.6 ms
15 2025-04-2561.1 ms18.9 ms147 ms31.5 ms20.1 ms1.9 ms63.9 ms107 ms21.7 ms258 ms16.5 ms
14 2024-05-0761.2 ms19.4 ms145 ms32.6 ms20.0 ms2.1 ms63.4 ms106 ms21.6 ms259 ms16.5 ms
13 2023-04-26-----------
12 2022-05-06-----------
11 2021-04-27-----------
10 2020-05-07-----------
9 2019-05-03-----------
8 2018-05-02-----------
7 2017-05-02-----------
6 2016-04-27-----------
5 2015-04-22-----------

Speed across releases

Did C get faster? Every tracked release plotted at its release date, one line per build setting. Shows time, memory or binary size over all problems by default.

0.0 ms12 ms24 ms35 ms47 ms2024202520262023202220212020201920182017201620151615141312111098765gcc -O2gcc -O2gcc -O3gcc -O3gcc -O3 -march=nativegcc -O3 -march=native

9 tracked releases have not been measured for this problem yet (13, 12, 11, 10, 9, 8, 7, 6, 5, shown faded on the axis). Lines appear as soon as a second release has data.

Each point is one language release on its official release date, measured on an average machine. Hover a line, its label or a legend button to highlight it; hover a point for release highlights. “All problems” is the geometric mean over every scored problem; releases not yet measured on all of them are left out.

Release highlights

  1. C 16 2026-04-30
    GCC 16.1 release
  2. C 15 2025-04-25
    C23 becomes the default C dialect (-std=gnu23) · COBOL front end added
  3. C 14 2024-05-07
    Implicit int / implicit function declarations become errors by default in C · -fhardened option · AMD Zen 5 support
  4. C 13 2023-04-26
    C2x/C23 feature work, new -fanalyzer checks · Modula-2 front end added
  5. C 12 2022-05-06
  6. C 11 2021-04-27
  7. C 10 2020-05-07
  8. C 9 2019-05-03
  9. C 8 2018-05-02
  10. C 7 2017-05-02
  11. C 6 2016-04-27
  12. C 5 2015-04-22

Badge

Show this language's overall rank in your README or website:

PreviewC rank on language-bench
Markdown[![C on language-bench](https://stijnris.github.io/language-bench/badges/c.svg)](https://stijnris.github.io/language-bench/languages/c/)
HTML<a href="https://stijnris.github.io/language-bench/languages/c/"><img src="https://stijnris.github.io/language-bench/badges/c.svg" alt="C on language-bench"></a>