C vs Python
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.
| Problem | C | Python | Ratio (95% CI) |
|---|---|---|---|
| Binary Trees | 60.2 ms / 2.5 MB / 25 kB | 288 ms / 9.3 MB / no binary | 0.21× (0.20×–0.22×) |
| Fannkuch-redux | 18.7 ms / 0.4 MB / 17 kB | 475 ms / 6.2 MB / no binary | 0.04× (0.04×–0.04×) |
| File processing | 146 ms / 1.4 MB / 18 kB | 913 ms / 6.8 MB / no binary | 0.16× (0.15×–0.17×) |
| Hash map | 31.0 ms / 20.5 MB / 17 kB | 397 ms / 135 MB / no binary | 0.08× (0.06×–0.10×) |
| JSON parsing | 19.6 ms / 20.4 MB / 21 kB | 714 ms / 154 MB / no binary | 0.03× (0.03×–0.03×) |
| Matrix multiply | 2.0 ms / 3.2 MB / 21 kB | 954 ms / 18.1 MB / no binary | 0.00× (0.00×–0.00×) |
| N-Body simulation | 64.1 ms / 0.4 MB / 21 kB | 6.42 s / 6.6 MB / no binary | 0.01× (0.01×–0.01×) |
| Parallel reduction | 105 ms / 0.5 MB / 17 kB | 2.19 s / 16.6 MB / no binary | 0.05× (0.05×–0.05×) |
| Prime sieve | 21.4 ms / 10.4 MB / 17 kB | 395 ms / 41.1 MB / no binary | 0.05× (0.05×–0.06×) |
| Sorting | 267 ms / 16.2 MB / 17 kB | 756 ms / 106 MB / no binary | 0.35× (0.32×–0.38×) |
| String operations | 16.6 ms / 13.8 MB / 21 kB | 72.6 ms / 42.4 MB / no binary | 0.23× (0.22×–0.23×) |
Over time
How both languages changed from release to release (default build). Switch problem or metric above the chart.
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.