Used too much CPU time on onVehicleEntityCollision()
See original GitHub issueBkCommonLib version: 1.12-v2 (build 75 on Jenkins)
TrainCarts version: 1.12-v1
Spigot version: 1.12
Problem or bug:
TrainCarts used too much CPU time while processing VehicleEntityCollision event, here is a profiler log screenshot:
onVehicleEntityCollision used more than 60% CPU time and causing server lag, is there any improvement can be applyed on reflection works (which caused 40% CPU time)?
Expected behaviour:
Not use that much CPU.
Steps to reproduce:
I cannot ensure which part caused these works taking so much time, but use /train list
command and get:
51 trains on the server (2 are moving)
But I think 2 moving trains should not take 60% CPU times.
cc @sntc06 @fntsrlike (who maintains the same server with me)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:18 (11 by maintainers)
Top Results From Across the Web
How to Fix High CPU Usage - Intel
Find out all the reasons why your PC displays high CPU usage. Our step-by-step guide will show you how to fix your CPU...
Read more >Guidance for troubleshooting high CPU usage - Windows Server
Introduces general guidance for troubleshooting scenarios in which you experience high CPU usage.
Read more >How to Lower CPU Usage: Common Causes & Tips - N-able
The symptoms of high CPU usage are familiar: the cursor moves jerkily and slowly, and applications begin to lag or shut down.
Read more >How to Fix High CPU Usage in Windows - AVG
Long-term high CPU usage (say 90-100%) can cause computer freezes & crashes. Find the cause and fix high CPU usage on Windows today....
Read more >What is CPU usage, and how to fix high CPU usage
If your PC has slowed down, high CPU usage may be the cause. In this guide, we will show you how to check...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
https://ci.mg-dev.eu/job/BKCommonLib/137/ https://ci.mg-dev.eu/job/TrainCarts/64/
This has many new goodies and a way to avoid creating a DefaultEntityController that causes most of the lag. There will probably still be some hotspot in CommonEntity.get(), I’d be interested in seeing the full details of that if it still poses problems.
We tried the new build, and the TPS is massively improved. Even in most densed area filled with minecarts in our server, TPS still have a decent 16~18. Thanks for all the great work you’ve done!
I attach the final profiling snapshot for your reference. Profile: https://www.dropbox.com/s/ttsr6sh8gq4643j/profile4.nps?dl=0 Image: https://www.dropbox.com/s/yjags8ykjmxamfd/profile4.png?dl=0