Skip to content
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

Scrolling matching items to other inventory is unusably slow and sometimes runs out of memory #34

Open
vlad2305m opened this issue Apr 15, 2023 · 0 comments

Comments

@vlad2305m
Copy link

(relay up the fork network if applicable)
For certain items (like shulkers), isEqual check is VERY expensive, and this code uses it like it's the cheapest thing in the world.

// Failed to shift-click items, try a manual method

Reproduction:

  1. Have ~20 shulker boxes of pistons in your inventory
  2. Open a double chest with ~40 of the same boxes in it
  3. Try to alt scroll (possibly multiple times at once by accident) and observe extreme lag and possibly a crash.

Suggestion:
For starters you could just check that the reference item is unstackable, so there is no point in many of those checks. Futher, you could check that the destination slot is full to skip[checks. Shift click checks and manual move checks are so expensive with shulkers that I can literally see them being performed at ~50/second, so it is a bad idea to do them if something easier can fail earlier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant