language-bench

C vs Python

C is 18.4× faster
than Python overall (geometric mean over 11 problems). C wins 11, Python wins 0. C uses 7.24× less memory on average.

Newest release and default build of each (C 16, Python 3.15), compared problem by problem. “Ratio” is C time ÷ Python time: below 1.0 means C is faster. Each cell shows time / memory / binary size; the better value is green.

ProblemCPythonRatio (95% CI)
Binary Trees60.2 ms / 2.5 MB / 25 kB288 ms / 9.3 MB / no binary0.21× (0.20×–0.22×)
Fannkuch-redux18.7 ms / 0.4 MB / 17 kB475 ms / 6.2 MB / no binary0.04× (0.04×–0.04×)
File processing146 ms / 1.4 MB / 18 kB913 ms / 6.8 MB / no binary0.16× (0.15×–0.17×)
Hash map31.0 ms / 20.5 MB / 17 kB397 ms / 135 MB / no binary0.08× (0.06×–0.10×)
JSON parsing19.6 ms / 20.4 MB / 21 kB714 ms / 154 MB / no binary0.03× (0.03×–0.03×)
Matrix multiply2.0 ms / 3.2 MB / 21 kB954 ms / 18.1 MB / no binary0.00× (0.00×–0.00×)
N-Body simulation64.1 ms / 0.4 MB / 21 kB6.42 s / 6.6 MB / no binary0.01× (0.01×–0.01×)
Parallel reduction105 ms / 0.5 MB / 17 kB2.19 s / 16.6 MB / no binary0.05× (0.05×–0.05×)
Prime sieve21.4 ms / 10.4 MB / 17 kB395 ms / 41.1 MB / no binary0.05× (0.05×–0.06×)
Sorting267 ms / 16.2 MB / 17 kB756 ms / 106 MB / no binary0.35× (0.32×–0.38×)
String operations16.6 ms / 13.8 MB / 21 kB72.6 ms / 42.4 MB / no binary0.23× (0.22×–0.23×)

Over time

How both languages changed from release to release (default build). Switch problem or metric above the chart.

0.0 ms194 ms387 ms581 ms775 ms20252026PythonPythonCC

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.

Times are shown for the average machine (see methodology). A ratio whose 95% interval includes 1.0 is not a clear difference.