The awesome response to the Stand-up Maths generated many solutions.
The best one unti I'm writing this code is from miniBill which was writen in Rust.
I'm a Rust newbie, but I know some of C++ and I took a couple of hours to "translate" the code from Rust to C++.
Pure C++ and boost::iostream to memory mapped file to be portable.
The same performance on my machine, using the same techiniques... It's very nice to see that Rust is as fast as C++ (your write less in Rust thow, but I find it more dificult to read... for now at least).
Se what can be done to improve performance using:
- Allocators
- std::bitset
- Better containers
- Change the aproach for C++20 Ranges (it's almost incredible but some algorthms get almos 20% of improvement in C++20 Ranges style - don't ask me why)
- ???