My take on FizzBuzz
The current state of affairs is:
- fizzbuzz.avx2.S is currently the top submission at stackoverflow/codechef. This solution has a buffer overwrite issue that I caught with testread.cpp. The competition uses "pv" which is a generic reader and only counts bytes. Check out with:
./fizzbuzz.avx2 | ./testread-
My solution (fizzbuzz.cpp) generates about 4GB/s per thread and scales linearly up to around 30 Gb/s when vmsplice() issues arise
-
I tried another approach in fbthread.cpp but that's not compiling so commented out in CMakeLists.txt
-
fbinterleaved was a neat idea but it turns out cache contention makes it very slow. It's there for completeness.
Typical cmake build:
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make