tom5454 / More-Immersive-Wires

Add modded wire support for Immersive Engineering
MIT License
1 stars 2 forks source link

Serious Performance Issue (And potential solution) #9

Closed wiggle1000 closed 6 months ago

wiggle1000 commented 6 months ago

Hello! I've been using this mod (Version 1.1.2, but it seems it's still like this) on a server with my friends for a few months, and I was having some pretty extreme TPS issues. I finally decided to install a performance profiling mod and noticed that this mod was the cause!

I took a look at the source code and realized that there appears to by a typo in SimpleNetworkHandler.java causing it to iterate over the connections every frame, rather than when a change occurs.

As a test, I downloaded the codebase and moved the last line into the needsUpdate if statement, and the problem was immediately solved.

Here's a spark profiler output from before the change: https://spark.lucko.me/HA4Kz4V8YO

And after: https://spark.lucko.me/RV3uwNOP0v

(I would submit a pull request, but I ran into issues setting up the project properly and didn't want to risk making a mess)