-
-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimized Rect/FRect
pgRect_FromObject
#2041
Optimized Rect/FRect
pgRect_FromObject
#2041
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
I get the same speedup testing locally with this testing. noticed one line that looks to need deleting, but otherwise looks alright to me.
Co-authored-by: Dan Lawrence <[email protected]>
160c59e
to
60a0921
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the PR 🍰
I have ported #1843 since the last addition of FRect. I also updated my test program to produce more compact results. This PR should speed up all functions that accept a Rect-like as param. Actual Rect/FRect object as parameters are not affected.
This means that functions that take sequences like (x, y, w, h) or ((x, y), (w, h)) should benefit from this.
Results:
FRect
OLD
NEW
Rect
OLD
NEW
The code I used: