6 points modulovalue 2 hours ago 1 comments

Panzerschrek 2 minutes ago | parent

> Instead of testing every byte, OR every byte into an accumulator and check the high bit once at the end.

It's not an optimization, in many cases it's a pessimization if a large string has non-ASCII characters right at the start (or close to it). Iterating only a small fraction of the given string with branching is faster than iterating it all without branching.