-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
Closed
Labels
performancePerformance or resource usagePerformance or resource usage
Description
Initially I just planned to get rid of PyLong_AS_LONG (undocumented transitional alias of PyLong_AsLong) in Objects/unicodeobject.c. But I have used opportunity to add few optimizations in the nearby code. I do not expect significant performance boost, but some overhead was removed in specific corner cases:
PyLong_AsLongAndOverflowis now only called once for the replacement code (PyLong_AS_LONGwas called twice).- Using
PyMapping_GetOptionalIteminstead ofPyObject_GetItemallows to avoid raising aKeyErrorif the translation table is adict. I left this case in previous round (Add PyMapping_GetOptionalItem() #106307) because this does not make the code simpler (we still need to handle otherLookupError), but it still has a tiny performance benefit.
Linked PRs
Metadata
Metadata
Assignees
Labels
performancePerformance or resource usagePerformance or resource usage