GlobbyPotato / Rockhounding_Chemistry

The purpose of Rockhounding Chemistry is to assembly and maintain an industrial area in which several machines handle various types of ingredients (solid, fluid and gaseous) to produce advanced material for mid-late game stages. It also leads to several features, functional applications and experiments.
Other
15 stars 17 forks source link

com.globbypotato.rockhounding_chemistry.handlers.GlobbyEventHandler.onWorldTick() Using a lot of CPU #58

Closed wormzjl closed 6 years ago

wormzjl commented 6 years ago

I've started a server with RH chemistry, but the TPS was pretty low so I checked it with a profiler. From the profiling result I found that com.globbypotato.rockhounding_chemistry.handlers.GlobbyEventHandler.onWorldTick() is using a lot of cpu time (17% in total) even if players haven't made anything related to RH yet. I have hazard and pollution enabled in config.

image

image

Here is the full profiler result if you are interested: https://sparkprofiler.github.io/?11vRsUXu8m

GlobbyPotato commented 6 years ago

Seems to be the toxic mutation process causing this. Probably set something wrong, been trying the way to make it less invasive avoiding the WorldTick. I'll give it a look. The entire feature is still in progress, is it so heavy to require an immediate hotfix to disable the feature?

wormzjl commented 6 years ago

Yeah when I enabled this I guess that there will be some sort of problem, I'll disable it for now.

GlobbyPotato commented 6 years ago

I actually remembered there was a better way of doing this without involving the event. Will test it as I get a free hour and possibly push an hotfix.

wormzjl commented 6 years ago

Seems that even with "enable hazard"=false it's still on the profiler with 18% ticktime

GlobbyPotato commented 6 years ago

did you tried v3.22. that method is no longer used

wormzjl commented 6 years ago

Great, it's no longer on the list However I haven't tested with pollution enabled, so you might want to take a look at its performance