Speed up BaseExceptionGroup.{derive,subgroup,split}
by ~20%
#111666
Labels
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
performance
Performance or resource usage
There's a simple change that we can make to increase the preformance of these three methods. Right now they are defined as:
cpython/Objects/exceptions.c
Lines 1491 to 1493 in f4b5588
However, they only ever use one argument:
cpython/Objects/exceptions.c
Lines 883 to 885 in f4b5588
So, it would be much faster to use
METH_O
instead. I did these measurements, before and after:Linked PRs
BaseExceptionGroup.{derive,split,subgroup}
#111667The text was updated successfully, but these errors were encountered: