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

[Bug] TPS Lag caused by me.ryanhamshire.GriefPrevention.DataStore.getClaim() #50

Open
DarkChromaMC opened this issue Aug 31, 2024 · 4 comments
Assignees
Labels
improvement Improvement of a feature

Comments

@DarkChromaMC
Copy link

Describe the bug
We are experiencing significant server lag (8%) of tick at higher player counts. It seems to specifically come from me.ryanhamshire.GriefPrevention.DataStore.getClaim() method.
https://spark.lucko.me/0oIUisWjFY


ERROR MESSAGE

## Replace me with the error message ##

Additional server information
GriefPrevention version: 16.18.4
BanFromClaim version: 1.7.4
Server version (use /ver): 1.21.1
Plugin list:

@DarkChromaMC
Copy link
Author

The plugin appears to be checking if the player is in a claim from which they have been banned in a roundabout way. Could we please use DataStore#getClaimAt instead of DataStore#getClaim?

@Baktus79
Copy link
Owner

Baktus79 commented Sep 1, 2024

I'm not sure how DataStore#getClaimAtshould be more efficient than DataStore#getClaim. But I will look into it to see if there is any difference between those two.

@DarkChromaMC
Copy link
Author

It seems another plugin (GPFlags), also reported this issue a couple weeks ago, and pushed a fix to change to DataStore#getClaimAt. Here's the GitHub report discussion about it: GriefPrevention/GriefPrevention#2249

@Baktus79
Copy link
Owner

Baktus79 commented Sep 1, 2024

Got some info about the issue from RoboMWM, DataStore#getClaimAt operates much different than DataStore#getClaim. As it only gets a subset of claims based on the chunk, rather than all claims, and that the search is in a hashmap makes it more efficient.

I will change it within the next release.

@Baktus79 Baktus79 added the improvement Improvement of a feature label Sep 1, 2024
@Baktus79 Baktus79 self-assigned this Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement of a feature
Projects
None yet
Development

No branches or pull requests

2 participants