One of my job tasks was improving our custom string library. In VB!
Sure InStr was slow: but we were trying to do "starts with" across very long strings.
Sure, it worked, but a slightly smarter solution was 100 times faster.
Upon finding it I went on a search, I found it written nearly identical 10 years before me, in a different version of a string library (hint, that one was faster).
The trick to knowing we needed to improve it: profiling!