really appreciated the blog post, and the code - but it might be nice if the README included commands to (re)-generate the results.csv-file, along with how to compile and run the c-code? (eg: make fizzbuzz - no Makefile needed - except one would want -O3 etc...).
Personally, as a relative newcomer to "production" python, I'd also love to see some more expansion on:
It’s worth noting that the technique I used to produce the extension modules to test was literally pip install mypy; mypyc .../module.py, then python -c “import module”.
Maybe something along the lines of (I'm sure there are better approaches):
Compile the C code
make fizzbuzz
mv fizzbuzz fizzbuzz.unopt
CFLAGS="-O3" make fizzbuzz
mv fizzbuzz fizzbuzz.o3
Quick test - pipe through pv for gauging speed:
./fizzbuzz.unopot | pv -a > /dev/null
[ 145MiB/s]
./fizzbuzz.o3 | pv -a > /dev/null
[ 152MiB/s]
Quick test - python
python src/fastfizzbuzz/python_template.py | pv -a > /dev/null
[81,6MiB/s]
python src/fastfizzbuzz/python_naive.py | pv -a > /dev/null
Hi,
really appreciated the blog post, and the code - but it might be nice if the README included commands to (re)-generate the results.csv-file, along with how to compile and run the c-code? (eg:
make fizzbuzz
- no Makefile needed - except one would want-O3
etc...).Personally, as a relative newcomer to "production" python, I'd also love to see some more expansion on:
Maybe something along the lines of (I'm sure there are better approaches):
Compile the C code
Quick test - pipe through pv for gauging speed:
Quick test - python
Quick test - python - mypy