A fast fizzbuzz implementation with light use of SSE2. Linux only. Outputs at ~2.5GiB/s on my laptop, see below.
This implementation caps out at 10^16, or on the order of 2^53.
For reference, on my computer:
- Simple FizzBuzz implementation yields 29MiB/s
- Aiden4's FizzBuzz in Rust pipes about ~1.7GiB/s
- The legendary FizzBuzz implementation by ais253 does ~20GiB/s
With the command:
taskset 3 sh -c "RUSTFLAGS=\"-C opt-level=3 -C target-cpu=native\" cargo run --release" | taskset 4 pv > /dev/null
I get 100GiB in 40 seconds, so a sustained 2.5GiB/s (it increases as the numbers get bigger though). You may need to play around with the CPU numbers on your machine.