[go: nahoru, domu]

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 Issues with Command Preprocessing #12

Closed
R00tB33rMan opened this issue Jul 16, 2023 · 9 comments · Fixed by #24
Closed

Performance Issues with Command Preprocessing #12

R00tB33rMan opened this issue Jul 16, 2023 · 9 comments · Fixed by #24
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@R00tB33rMan
Copy link

https://spark.lucko.me/Ryze54w182

image

Plugins like MyCommand and DeluxeMenus (plus potentially others) do not bode well with SignedVelocity's command listener. Not exactly sure what to recommend here; however, I'm assuming this may have been an accidental oversight or unexpected occurrence.

@4drian3d
Copy link
Owner

https://spark.lucko.me/Ryze54w182

image

Plugins like MyCommand and DeluxeMenus (plus potentially others) do not bode well with SignedVelocity's command listener. Not exactly sure what to recommend here; however, I'm assuming this may have been an accidental oversight or unexpected occurrence.

What is happening is that for some reason, MyCommand and DeluxeMenus are using the Player#chat method to execute commands from the player instead of the Server#dispatchCommand or Player#performCommand method. This causes the server to consider that the player has actually executed the command on its own, and when going through SignedVelocity's command listener, it waits a maximum of 150 milliseconds on each use of that method for Velocity to send the procedure to execute on that command, but Velocity has never processed that command, so it waits unnecessarily 150 milliseconds and then proceeds with the command execution.
This is a bad implementation of MyCommand and DeluxeMenus by making incorrect use of the Bukkit API. Still, it could be "fixed" from SignedVelocity using a StackWalker, I'll see if I can implement it one of these days.

@4drian3d 4drian3d added help wanted Extra attention is needed good first issue Good for newcomers labels Jul 16, 2023
@R00tB33rMan
Copy link
Author
R00tB33rMan commented Jul 16, 2023

Ah! That makes complete sense. I appreciate the far more insightful information regarding this issue. I had a feeling it could have come from one or both parties.

@R00tB33rMan
Copy link
Author

Hey! I noticed roughly a week ago that you've applied some changes that improve this resource's performance. Could this potentially resolve this presented issue or not at all?

@4drian3d
Copy link
Owner
4drian3d commented Sep 7, 2023

Hey! I noticed roughly a week ago that you've applied some changes that improve this resource's performance. Could this potentially resolve this presented issue or not at all?

Totally, I had planned to mention it in this issue, but I forgot, sorry😅

@4drian3d
Copy link
Owner
4drian3d commented Sep 7, 2023

This specific problem was easily solved in SignedVelocity-Sponge as the platform provides APIs to identify these cases. In case of Paper, I still have to try to fix this on my own.
In summary, the performance changes that have been made from BETA 3 to version 1.0.1:

  • Reduced the timeout from 150 to 100 milliseconds(could be reduced a bit more, but I need to do a lot more testing).
  • In case the player uses a very old version (<1.18.2), it would be possible to cancel the command/message directly from the proxy as there would be no need to handle it from the server.

In short, the problem will still be present until I do a proper workaround that takes into account all the variables in which this can happen, but the problem will affect your server 30% less with these changes.

@4drian3d

This comment was marked as outdated.

@4drian3d
Copy link
Owner

Could you try the version of pull request #24? According to the tests I did, it fixes the problem by detecting these cases

the test version is published there

@4drian3d
Copy link
Owner

Could you try the version of pull request #24? According to the tests I did, it fixes the problem by detecting these cases

the test version is published there

Tested

Before:

Now:

@R00tB33rMan
Copy link
Author

I somehow entirely lost track of this. Looks to be vastly better. Very nice job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants