Clumps

Clumps

206M Downloads

Some small lag

someaddons opened this issue ยท 4 comments

commented

Just noticed when profiling that clumps takes a bit more calculation time than it probably needs, as it is search the whole global entity list every single tick. And is it supposed to search on both pre and post server tick?

image

I think either a reduced checking rate, like every 10 ticks(0.5seconds) or subscribing to the enter world event of entities would be better.

commented

You'll notice in the git commits that we used to use the entity join world event, but it was leading to other issues (probably half the issues on this repo tbh)

It should only need to look on the post tick, so that should cut it a bit, but I'm not too keen on only searching every X tick, ideally we remove xp orbs as soon as they join, otherwise it kinda cuts the performance improvements in general (if I only kill xp orbs every 5 ticks, there are 4 ticks for more orbs to spawn, and a lot of orbs can spawn in a single tick.

What I have done though, and I'm hoping you won't mind running a test with it, is use the join world event to keep a list of xp orbs and from there remove those orbs directly in the world tick event (only during post, not pre)

https://i.blamejared.com/Clumps-6.0.0-performance.jar

This should cut it down a bit.
it is for 1.16, but I'm willing to port it to 1.15 if that is easier to test on

commented

ye atm I could only test it on 1.15, we don't have a 1.16 server yet and it probably makes sense to test in a bigger scale. Btw what were the issues with the entity join events? Afaik you can cancel the event to stop the spawn and not have any log spam from vanilla

commented

sorry it has taken me so long to get back, have been busy with other projects.

So I released this version because I know it works (have been testing it on a server for the past 2 weeks on 1.16), but I would really appreciate some performance metrics if you can provide them :)

https://www.curseforge.com/minecraft/mc-mods/clumps/files/3037822

commented

closing this since the new design is much better performing as it no longer checks the full world entity list each tick