OK I had another idea while doing something else. Just for kicks, here's a new record holder. It's about 23x faster than Randall's and should get you in the low 100ms. (My ancient 1GHz PIII laptop does a 4MB string input in less than 250ms).
I originally thought that "decimate array" causes a buffer allocation. Apparently, it does not!
🙂Anyone has an idea to speed it up a bit?
(Sorry about these multiple post. I'm sure CC will suspect "other" motives ;))