3 ms·
Why not do a bit check optimization instead of looking at whole characters?
by shortcj 13y ago
Why not do a bit check optimization instead of looking at whole characters?
- Wilya 13y agoI'm not an expert, but I don't think you can do pure bit checks in a modern CPU. It likely does comparisons of char in a single hardware instruction anyway. Actually, if you look at the nginx source I linked, the comparisons of the full strings are hidden behind macros because they do the opposite: they group characters 4 by 4, and do 32bit int comparisons as much as possible.
- shortcj 13y agoan immediate value stored in an instruction would double performance over an l1 data cache reference... but this is stated just to mock people on this thread who want 'almost' machine level logic to match robust user land permutations.