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

Add toggle for simplified hopper logic #322

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

T14D3
Copy link
Contributor

@T14D3 T14D3 commented Nov 26, 2024

The default hopper logic can be incredibly performance heavy especially on servers with large amounts of hoppers (as seen by #306), so this PR implements a toggle for greatly simplified hopper handling, which simply prevents any hopper from pulling items from any protected chest.

In my tests this resulted in a 10-15% performance improvement with a medium sized storage system.

@T14D3 T14D3 requested a review from spnda as a code owner November 26, 2024 11:28
Copy link
Owner

@spnda spnda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did you test the performance improvement exactly? I have wanted to rewrite the NBT handling for a while now to be a lot more performant, but just haven't found the time. Seeing as it's a quite big deal and multiple people have reported it I might just check it out soon (I have some free time now).

Comment on lines +411 to +413
public boolean isSimpleHopperProtection() {
return simpleHopperProtection;
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you perhaps have any information on the performance of config.getX functions, given that I usually just call them instead of caching the variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Config gets stored in memory when the load is called, so from there everything is memory only anyways - moving over to having the bool in a dedicated variable might be a bit of an improvement but certainly not by much

@T14D3
Copy link
Contributor Author

T14D3 commented Nov 26, 2024

How did you test the performance improvement exactly? I have wanted to rewrite the NBT handling for a while now to be a lot more performant, but just haven't found the time. Seeing as it's a quite big deal and multiple people have reported it I might just check it out soon (I have some free time now).

Let the server process the storage system for 10 minutes each and looked at spark afterwards, mainly looked at general mspt and percentage used by the plugin

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

Successfully merging this pull request may close these issues.

2 participants