&gt; which run in 4 cycles per byte + 8 cycles of fixed cost. That&#x27;s cheap as dirt.<p>Cheap? 12 precious clock cycles is enough for up to 384 floating point operations (FMA).<p>Not sure how fast or slow rep sca&#x2F;mov is these days. Regardless, strlen that is not scanning at least 4 bytes per clock is hopelessly slow. I think you can do at least about ~16 bytes per clock.<p>Anyways, the problem with strlen is unnecessary extra (potentially mispredicted) branches and memory accesses.<p>I have seen enough cases where strlen has dominated cost in the profile. Of course this depends entirely what you are doing, there are plenty of workloads where strlen just doesn&#x27;t occur.