Klyn benchmark

Performance samples

Each Python / Klyn / C++ trio is executed three times. The displayed values are average wall-clock process times. The C++ column uses an executable compiled with g++ -O3 -std=c++20 -o <name> <name>.cpp.

Test Python Klyn --clean* Klyn C++ -O3
ComputePI
Computes 1500 digits of PI with a bounded-integer spigot algorithm.
1671.74 ms 177.00 ms9.44x faster than Python 54.87 ms30.47x faster than Python 31.93 ms52.35x faster than Python
Mandelbrot
Renders a 1000x700 Mandelbrot set to a binary PPM image.
1185.88 ms 219.33 ms5.41x faster than Python 77.91 ms15.22x faster than Python 39.14 ms30.30x faster than Python
Prime
Finds the first 400000 prime numbers with the Sieve of Eratosthenes.
1617.83 ms 169.18 ms9.56x faster than Python 76.26 ms21.22x faster than Python 25.80 ms62.71x faster than Python
* Klyn --clean removes the local cache before each execution. This column measures the worst startup scenario: rebuilding generated objects and then running the script. The Klyn column measures the normal cached startup path.

The benchmark source files are included in the Klyn distribution under samples/perf for curious users who want to inspect, run, or adapt them.