Skip to content

Add cython implementation - #222

Open
poudro wants to merge 2 commits into
bddicken:mainfrom
poudro:add_cython
Open

Add cython implementation#222
poudro wants to merge 2 commits into
bddicken:mainfrom
poudro:add_cython

Conversation

@poudro

@poudro poudro commented Dec 7, 2024

Copy link
Copy Markdown

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.

@bddicken

bddicken commented Dec 9, 2024

Copy link
Copy Markdown
Owner

Interesting! Wanna add the fib test case as well?

@poudro

poudro commented Dec 9, 2024

Copy link
Copy Markdown
Author

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 :)

@miraculixx miraculixx mentioned this pull request Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants