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.
1597.42 ms 127.70 ms12.51x faster than Python 43.02 ms37.14x faster than Python 39.54 ms40.40x faster than Python
Mandelbrot
Renders a 1000x700 Mandelbrot set to a binary PPM image.
1248.37 ms 77.05 ms16.20x faster than Python 38.24 ms32.64x faster than Python 33.51 ms37.26x faster than Python
Prime
Finds the first 400000 prime numbers with the Sieve of Eratosthenes.
1401.36 ms 66.53 ms21.06x faster than Python 29.46 ms47.57x faster than Python 20.47 ms68.45x 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.