Open itzpr3d4t0r opened 4 weeks ago
I must report that this change has drawbacks, specifically with Rect/Frect subclasses. You can easily see it from this graph, so even tho we see significant improvements in basically all cases, rect subclasses get significantly slower.
I think we shouldn't prioritize Subclasses performance over the most prevalent usecases such as direct Rect/Frect usage or tuples/lists/sequences/separate args passed as rects.
This PR speeds up virtually all Rect/Frect functions. It achieves so thanks to modifications to the
pgRect_FromObject
function that are:PyObject_IsInstance
)pgRect_FromObject
is nowPG_FORCEINLINE
I've seen variable benefits, but they're generally quite good:
Results
Data to construct those results
Test program to generate the data: