4 ms·
But not a constant number of clock cycles. A comparison that fails on the first bytes can bail out early.
by kryptiskt 8y ago
But not a constant number of clock cycles. A comparison that fails on the first bytes can bail out early.
- colanderman 8y agoTo be fair, Intel's recent offerings include 512-bit registers [1]. I highly doubt std::string takes advantage of them. [1] https://en.wikipedia.org/wiki/AVX-512 https://en.wikipedia.org/wiki/AVX-512
- rurban 8y agoIt shouldn't because it slows down the whole core not to get too hot. 256 is the best size to use.
- dagenix 8y agoI accidentally chopped off the quote too early. The rest of it was: > (rather than comparing strings which requires O(n) cycles and memory reads)