Re:Parsing short hexadecimal strings efficiently
by BonesJustice on Wednesday April 17, 2019 @06:31PM
(#19687017)
Wouldn’t the ‘valid’ values in such a table be relatively sparse, creating a high likelihood of cache misses? The guy’s agonizing over 4 cycles, but a cache miss is far more costly.
Re:Parsing short hexadecimal strings efficiently
by hairtuq on Wednesday April 17, 2019 @06:22PM
(#19686962)
I tried using https://github.com/falk-hueffner/sematrope. Best I can get is x - ((x >> 4) ^ 0x33), should be slightly faster. EDIT: unfortunately that works only for upper case letters.
For that matter, I'd want to run the author's "fancy math-based function" through a superoptimizer and check that there isn't something that can do the job in fewer cycles.