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.
1316.06 ms 74.72 ms17.61x faster than Python 30.29 ms43.45x faster than Python 28.78 ms45.73x faster than Python
Mandelbrot
Renders a 1000x700 Mandelbrot set to a binary PPM image.
1194.41 ms 76.50 ms15.61x faster than Python 36.01 ms33.17x faster than Python 29.73 ms40.17x faster than Python
Prime
Finds the first 400000 prime numbers with the Sieve of Eratosthenes.
1293.89 ms 58.08 ms22.28x faster than Python 24.55 ms52.70x faster than Python 18.22 ms71.00x 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.