in reply to Re^4: Challenge: CPU-optimized byte-wise or-equals (for a meter of beer) (addr math)
in thread Challenge: CPU-optimized byte-wise or-equals (for a meter of beer)
Yes, memchr() and related items usually end up implementing their loop in a single machine-language instruction on most processors. Given the relative infrequency of '\0' bytes, the added complexity of computation when one is found is outweighed by the much more efficient finding of them.
- tye
|
|---|