-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Improve sprite ordering speed #3554
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.
I also find that using sort_unstable_by
improves performance.
The render items are sorted again in sort_phase_system
, but I think that should not become an unstable sort to avoid breaking batches.
The change means that sprites with a depth of NaN
may be reordered differently in sort_phase_system
, but that's fine by me.
This comment has been minimized.
This comment has been minimized.
a506153
to
ce183ca
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.
The logic with the index indirection seems incorrect.
d7a5c75
to
7095163
Compare
turns out keeping a smaller index is slower when done without a bug, I removed it |
this will change quite a bit with / is already part of #3460 |
Objective
Solution
partial_cmp
instead ofcmp
throughFloatOrd
sort_unstable_by
instead ofsort_by
results on my laptop:
partial_cmp
sort_unstable_by
the screenshots!
base
partial_cmp
sort_unstable_by
both