Once upon a time, Jon Bentley wrote one of his Programming Pearls (IIRC) about two string reversal algorithms; both were Big-O identical, but one finished in seconds on a sufficiently large string and he killed the other after several minutes. The punchline was that the second was exactly pessimal with regard to paged VM.
This wasn't a new realization, even in 2010.
The neat thing is that Bentley's string could probably be reversed in cache today.
This wasn't a new realization, even in 2010.
The neat thing is that Bentley's string could probably be reversed in cache today.