People keep discovering that, embarrassingly, checking whether a string starts with a given substring is slower with s.startswith("foo") than with s[:3] == "foo". The reason is that startswith requires a name lookup. I think we now have the machinery to special-case selected built-in method in the specializer? This would be a good candidate.
People keep discovering that, embarrassingly, checking whether a string starts with a given substring is slower with
s.startswith("foo")than withs[:3] == "foo". The reason is thatstartswithrequires a name lookup. I think we now have the machinery to special-case selected built-in method in the specializer? This would be a good candidate.