question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Used too much CPU time on onVehicleEntityCollision()

See original GitHub issue
BkCommonLib 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:

image

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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:18 (11 by maintainers)

github_iconTop GitHub Comments

3reactions
bergerkillercommented, Jul 5, 2017

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.

2reactions
sntc06commented, Jul 6, 2017

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found