The Computer Language
Benchmarks Game

Racket versus Python 3 fastest programs

Back in April 2010, Russ Cox charitably suggested that only fannkuch-redux, fasta, k-nucleotide, mandlebrot, nbody, reverse-complement and spectral-norm were close to fair comparisons. As someone who implemented programming languages, his interest was "measuring the quality of the generated code when both compilers are presented with what amounts to the same program."

Differences in approach - to memory management, parallel programming, regex, arbitrary precision arithmetic, implementation technique - don't fit in that kind-of fair comparison — but we still have to deal with them.

These are only the fastest programs. There may be additional measurements for programs which seem more-like a fair comparison to you. Always look at the source code.

spectral-norm
source secs mem gz busy cpu load
Racket 5.69 48,732 627 20.94 90% 98% 90% 90%
Python 3 169.41 52,492 443 673.42 99% 99% 99% 99%
n-body
source secs mem gz busy cpu load
Racket 54.09 48,096 1689 54.45 0% 0% 0% 100%
Python 3 797.11 8,036 1196 808.64 0% 100% 0% 1%
mandelbrot
source secs mem gz busy cpu load
Racket 19.96 132,920 801 75.17 96% 93% 93% 94%
Python 3 259.96 52,164 688 1,039.13 100% 100% 100% 100%
fannkuch-redux
source secs mem gz busy cpu load
Racket 84.19 45,584 1101 329.55 99% 99% 97% 96%
Python 3 472.21 49,992 950 1,867.32 100% 100% 96% 99%
binary-trees
source secs mem gz busy cpu load
Racket 18.50 1,082,164 853 48.11 65% 59% 60% 76%
Python 3 79.88 450,792 589 283.61 91% 85% 86% 94%
fasta
source secs mem gz busy cpu load
Racket 17.64 47,964 1280 17.82 1% 100% 0% 0%
Python 3 62.88 683,204 1947 139.86 47% 59% 56% 61%
pidigits
source secs mem gz busy cpu load
Racket 2.62 49,112 1136 2.69 1% 2% 100% 0%
Python 3 3.34 10,124 386 3.41 100% 1% 1% 0%
reverse-complement
source secs mem gz busy cpu load
Racket 17.46 666,928 1030 17.69 1% 100% 0% 0%
Python 3 17.70 1,007,220 814 22.18 23% 38% 17% 47%
k-nucleotide
source secs mem gz busy cpu load
Racket 93.27 395,208 885 93.97 0% 100% 0% 0%
Python 3 73.42 188,504 1967 279.54 94% 95% 95% 97%
regex-redux
source secs mem gz busy cpu load
Racket 26.28 1,248,488 729 58.17 4% 54% 67% 96%
Python 3 17.77 446,136 512 33.55 30% 77% 30% 51%
Racket

Welcome to Racket v7.2.

Python 3

Python 3.7.3