AtomicStryker's Infernal Mobs

AtomicStryker's Infernal Mobs

34M Downloads

[MultiMine] MultiMineServer.isUsingBannedItem() causing TPS lagg

ThaDaVos opened this issue ยท 9 comments

commented

I'm playing the RLCraft modpack (Minecraft 1.12.2) and I was experiencing big TPS drops when mining a block, after installing Spark-Forge and running a CPU profiler I think I found the cause and it's the MultiMine mod -> See screenshot
image

The link to the sparks results: https://sparkprofiler.github.io/#o19gsC0mqM

I removed the mod for now because of this.

commented

Looking at the code I don't see why there's a need to Load and Save the configuration each time:

final Configuration config = MultiMine.instance().config;
config.load();
result = config.get("banneditems", ident, false).getBoolean(false);
config.save();
blacklistedBlocksAndTools.put(ident, result);

commented

How else would "unknown" blocks and items ever show up in the config?

commented

There is a cache map (you see it written in line 277), but for the first occurence i have little choice besides putting down a new entry in the config file.

commented

I would say don't log them, leave it to the modpack dev to know what blocks and items to add. There are ways to find out what the id of the block you're looking at, or the item you're holding is already. No need to log it here.

commented

Ok listen. I don't actually support 1.12 anymore, and this is directly caused by other mods rather than bugs, but you caught me in a giving mood.

5f71aab

I have pushed the 1.12 build to curse aswell.

commented

For those who cant read the code: I added a config value to turn off the dynamic writing of unknown config values.

commented

Thanks for the change @AtomicStryker -> What you mean you don't support 1.12 anymore? You're working on newer versions?

commented

Just a curiosity question: why add them to the config file? If they are not mentioned there, then they are not banned, it's as simple as that (an alternative would be create the config file on load [Like most mods do as far as I know, or on a seperate thread but not every tick]) -> by loading and saving the config file everything time creates lots and lots of IO which is causing TPS lag -> on my server loading the config takes 15s, saving the same so 30s lagg for 1 tick

commented

If i am working on the mods at all, it will be on the current MC versions. I have all but dropped maintenance for several, too.