Comparing strings is often — erroneously — said to be a costly process. In this article I derive the theoretical asymptotic cost of comparing random strings of arbitrary length, and measure it in C, C++, C# and Python.
Modeling and measuring string comparison performance in C, C++, C# and Python.
10 Replies