CraftBook 3

CraftBook 3

139k Downloads

CraftBook performance issue

LadyCailinBot opened this issue · 10 comments

commented

CRAFTBOOK-3380 - Reported by Geitenijs

Hi,

I did a couple of timings reports in the last few days, which seem OK, except for CraftBook. We're also experiencing some lag because of this.
With just ICs and ToggleArea enabled, it uses over 175% of the server tick. (https://timings.aikar.co/?id=f5e42462b30145c4a268141b003e6440#plugins)
Can you optimize that a little? I'm not sure what CraftBook is constantly doing, but assuming it's just monitoring signs, it shouldn't take up that many resources. SignLink for example, does that too, but it's just at 9% of the server tick.

Thanks in advance!

commented

Comment by me4502

It appears it's the UUID converter that's taking a while - possible network slowdown?

You can disable it (As I'm assuming you don't need it anymore as the conversion happened 4 years ago) with the convert-names-to-cbids option in the config.

commented

Comment by Geitenijs

Thanks, that makes it a lot better! Still a little high, but definitely acceptable. https://timings.aikar.co/?id=4ab2b24cd38241d78472f4803ad56fa2#plugins

commented

Comment by me4502

To do anything beyond that, I’d need a profiling. Timings is very inaccurate for the kinds of stuff CraftBook does (it bundles all redstone as CraftBook etc)

If you have worldguard, you can use /wg profile -p
To generate one

commented
commented

Comment by me4502

From a quick look at that, CraftBook is only taking a tiny amount of time (less than SignLink)

The bit that it is taking is mostly due to an issue in Spigot where grabbing tile entities is way slower than it needs to be. There’s some API to partially work around this in Paper, so when I get time I’ll make it perform a bit better in Paper.

(To clarify, when I say tiny - I mean 1% of the CPU time was spent on CraftBook’s sign tasks)

commented

Comment by Geitenijs

Ah okay, that sounds good! Thanks for your support lately :)

commented

Comment by me4502

Try the next build, I've switched some places to use Paper APIs. There's one more place that can be made slightly faster in some cases, but that requires some extra work to be done in both Paper and PaperLib which I don't have time to do right now.

commented

Comment by me4502

Nice, I actually see a Paper bug in that profile, so I've reported that :P

I'll keep this open to remind me to submit the PR to paper to improve performance further (And also to fix that bug)

commented

Comment by me4502

The paper bug causing this slowdown was fixed btw. If you use latest Paper and CraftBook it should perform better.