You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[mypyc] Add faster primitive for string equality (#19402)
This speeds up self check by ~1.4%. String equality is one of the top
five most common primitive function calls in self check.
We previously used a string comparison primitive that calculated the
relative order of two strings. Usually we only care about equality,
which we can do quicker since we can fast path using a length check,
for example.
I checked the CPython implementation of string equality in 3.9 (lowest
supported Python version) and 3.13, and both of them had a fast path
based on string object kind, and equality checks overall had the same
semantics.
Current CPython implementation:
https://github.com/python/cpython/blob/main/Objects/stringlib/eq.h
Tests for this were added in #19401.
0 commit comments