Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Why not do a bit check optimization instead of looking at whole characters?


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


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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: