logoalt Hacker News

ASCII Validation from 2.5 to 114 GB/s with SIMD

11 points • by modulovalue • today at 2:28 AM • 4 comments • view on HN

Comments

Panzerschrek • today at 5:15 AM

> 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.

➕ show 1 reply
perching_aix • today at 6:57 AM

> These ten steps are as far as I could take this loop in Dart today. There is still some performance left. The good news is that I already know what it takes to get there, and I'm working on the compiler and library changes it needs. I hope they land soon, and that a future version of this post can end at full speed.

That sounds interesting. I quickly looked up the peak read of the L1D cache to be 192 GB/s, is that what's meant here? Or some other, more fundamental microarchitectural limit?

Is it possible to saturate that throughput and still have optimality to gain in some other aspect?

➕ show 1 reply