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
We can improve this by using freelists (for tracebacks and exceptions), using managed dicts for exceptions and improving the performance of attribute setters.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
I'm planning to use AC Vectorcall on the core exception hierarchy including AttributeError and KeyError which should help a number of cases although have to be careful in application. Some exceptions store the args tuple and going tuple -> Vectorcall -> tuple is slower than not doing vectorcall unless take special care.
OSError currently spends most its time re-encoding the output of strerror_r as a str which I plan to fix (just keep all the ones we've encountered as a dict of immortal strings).
Can I use this issue for that work or would you rather a separate one?
Activity
cmaloney commentedon Nov 3, 2026
👍 to adding a freelist.
I'm planning to use AC Vectorcall on the core exception hierarchy including AttributeError and KeyError which should help a number of cases although have to be careful in application. Some exceptions store the args tuple and going tuple -> Vectorcall -> tuple is slower than not doing vectorcall unless take special care.
OSErrorcurrently spends most its time re-encoding the output ofstrerror_ras astrwhich I plan to fix (just keep all the ones we've encountered as a dict of immortal strings).Can I use this issue for that work or would you rather a separate one?
pythongh-161242: Cache strerror() messages per errno
pythongh-161242: Cache strerror() messages per errno