languages
languages copied to clipboard
Add cython implementation
Thanks for the fun repo :)
This is pretty much cheating as this compiles down to C equivalent, but fun nonetheless
languages/loops/cython$ hyperfine -i --shell=none --runs 3 --warmup 2 "./code 40"
Benchmark 1: ./code 40
Time (mean ± σ): 649.8 ms ± 0.2 ms [User: 642.9 ms, System: 5.9 ms]
Range (min … max): 649.6 ms … 650.0 ms 3 runs
As a short explanation, Cython is a python library that allows to write python code, or very similar, and convert it to C for efficiency.
Interesting! Wanna add the fib test case as well?
Just added the fib test
languages/fibonacci/cython$ hyperfine -i --shell=none --runs 3 --warmup 2 "./code 40"
Benchmark 1: ./code 40
Time (mean ± σ): 852.5 ms ± 10.5 ms [User: 837.9 ms, System: 8.3 ms]
Range (min … max): 841.9 ms … 863.0 ms 3 runs
thanks for your interest :)