-
-
Notifications
You must be signed in to change notification settings - Fork 180
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
[MC1.16] [Client] Performance improvements for grid view #2705
[MC1.16] [Client] Performance improvements for grid view #2705
Conversation
Ah you misunderstood what I meant Your solution is much better ofc 😄 |
Just noticed while playing around that this fixes another problem... The search |
977e72a
to
5a3d9fb
Compare
This looks cool! I will try to review this PR this weekend. |
5a3d9fb
to
cd0c21f
Compare
Rebased to fix merge conflicts |
Plus refactor getFilters to avoid passing raw lists of filters around and instead use GridFilter objects that combine conditions through OR and AND.
This also follows the Law of Demeter a litle better.
Instead, use binary search and insert.
cd0c21f
to
4495b63
Compare
Rebased again, same reason |
Thanks! |
…inedmods#2705)" This reverts commit 74ab430.
See #2703. The changes are roughly the same as described there.
Testing this (and specifically, trying to reproduce the performance problems) was probably the hardest part. I stuck a bunch of importers around a chest and used a command block to fill it with junk:
This got me a lot of non-stacking items, and it was just a matter of leaving this running for a while.
To elaborate on the bugs I mentioned in the previous PR:
Crafter manager search bug:
Expected result: pattern grid shows up only
Actual result: pattern, grid, and pattern grid all show up as if you had typed
pat|gr
(which also does the same)|
at end of search bug:@ref|
Expected result: Since the user has (probably) not finished typing, the
@ref
search should still be valid. Either that, or it should be equivalent to "@ref
or<blank>
", i.e. all items.Actual result: Grid is blank
For completeness, screenshots (see perf graph on bottom left):
The regular lag spikes in 2 are from the importers constantly pulling in junk from the chest, and the grid view having to keep up with that. In 3 it looks like they're gone altogether (I did visually confirm that items were still jumping around in the grid). Note that frame times on the right-hand half of the graphs might be a little inflated because my screenshot utility is drawing above minecraft.
With this change,
preventSortingWhileShiftIsDown
can be safely disabled with negligible performance impact. Now it's just an option affecting gameplay, instead of performance overall, and can be enabled by anyone who doesn't like items jumping around under their cursor when they shift+click them.