Interpreter overheads of String::indexOf in particular seem excessive, with many redundant checks, partially pointless clamping of from-/toIndex (using Math::max) and other things.
Simplifying, streamlining and specializing the implementations rather than delegating significantly improves performance.
Simplifying, streamlining and specializing the implementations rather than delegating significantly improves performance.