Hacker News new | ask | show | jobs
by Oxryly 5685 days ago
I was assuming a 26 letter alphabet. At that point the shifting, anding and comparing would take place in registers.
1 comments

True, although if there are lower case letters too it could become a problem. At any rate, I'm not sure that the register aspect would improve speed significantly because of the latency of getting the string from main memory. You're still going to get pipeline stalls as you reach portions of the string that are not in the cache.
Yeah, the registers will only be faster than manipulating some sort of bool array. Reading the original string (with associated cache stalls) will certainly be necessary.