Skip to content

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

Copy link

stale bot commented Feb 24, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale A stale issue that was closed due to inactivity label Feb 24, 2025
@spnda spnda added enhancement New feature or request pinned A pinned issue that will not be considered stale and removed stale A stale issue that was closed due to inactivity labels Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request pinned A pinned issue that will not be considered stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants