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

Performance Improvements #3

Closed
maityyy opened this issue Nov 25, 2020 · 2 comments
Closed

Performance Improvements #3

maityyy opened this issue Nov 25, 2020 · 2 comments

Comments

@maityyy
Copy link

maityyy commented Nov 25, 2020

Hi, I haven't used your mod yet, but I was warned that it has poor performance and I decided to see why. I have one question for the code: does it really create a separate thread for each player? I see no reason to use a separate thread in principle for this.

@maityyy maityyy changed the title Performance Performance Improvements Nov 25, 2020
@maityyy
Copy link
Author

maityyy commented Nov 25, 2020

Thread creation is too expensive and it takes too many resources for each player. In addition, the player can exit and enter the server later (or there may be many players), due to which there will be an unacceptable amount of such allocations. This thread can be transferred to other tasks of the game. I suggest removing this logic and leaving the DeObfuscator class as a Runnable implementer for future code base changes.

@maityyy
Copy link
Author

maityyy commented Nov 25, 2020

As a last resort, we can use some implementation of the thread pool, but I'm not sure if the code slows down mspt that much. Its ticking after the player's tick also seems strange to me, maybe we just iterate over all the players?

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