Immersive Railroading

Immersive Railroading

3M Downloads

[1.12.2] Calling ITrack#getNextPosition can cause extreme lag

CSX8600 opened this issue ยท 2 comments

commented

In RailStuff/Traffic Control, the latest update now scans 10 blocks/tick by calling ITrack#getNextPosition, however, it appears that calculations in IR caused the server to lag so far behind that the ServerHangWatchdog thread eventually put it out of it's misery. Here's the stack trace it produced: https://pastebin.com/krrCr1t6

There may be other areas that produce similar complex calculations that could cause lag as well, so it might not be a horrible idea to take a quick scan and see if there's other areas with similar issues.

commented

thanks for the news. i will keep this in mind on our server

commented

A) You should probably cache this and check every 10-20 ticks
B) I've improved the performance dramatically in the latest test builds