-
Notifications
You must be signed in to change notification settings - Fork 4
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
Lasers are causing some nasty TPS lag #64
Comments
I'm seeing the same thing, even with fewer beams. My main test case was just one source, split through a prism and extending off into the distance with nothing blocking them. Adding the disco ball to one of the beams cause the client session to freeze completely. There's both an impact to the TPS and a possible continuously-growing memory requirement and/or a heavy allocation and release of memory causing frequent garbage collection delays. At least, that's what it feels like. The single-player client starts to pause at reducing intervals as soon as the beams are aimed at the horizon. If there are checks going on every tick at every point along a beam's length, that would be a problem. It such a case, I'd suggest adding a config option to limit the length of the beams. It's not necessarily realistic, but call it "sudden and catastrophic atmospheric absorption." :) |
I did all of my testing with Lag Goggles. I found that the lag caused by the laser block increases based on how complex the laser beam's path is. Each object the laser interacts with increases the TPS lag. I suspect it's recalculating the laser's path every tick. I see two solutions to this:
|
I have roughly 100 lasers setup in a test world, and this has brought the TPS down to a beautiful 2.2. Using Lag Goggles, it shows that each laser is using around 1,500 microseconds of CPU time per tick.
This affects both creative and survival lasers. The amount of lag created depends on the complexity of the laser's path. A simple laser traveling for one block and then harmlessly hitting a block only uses 186 microseconds per tick.
Lag Goggles screenshots:
Latest.log: https://gist.github.com/TheDeviantCrafter/fd8ea96e4797be6900d1570c9929a567
The text was updated successfully, but these errors were encountered: