3 ms·
It's probably much faster in most cases of text files though. I also think your constant time claim sounds too strong. You can eat a lot of end of line search
by alayne 11y ago
It's probably much faster in most cases of text files though.
I also think your constant time claim sounds too strong. You can eat a lot of end of line search time after the binary search and still beat a linear/regex search.
As someone else pointed out, look can also exit sooner.