CraftBook performance issue
LadyCailinBot opened this issue · 10 comments
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!
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.
Comment by Geitenijs
Thanks, that makes it a lot better! Still a little high, but definitely acceptable. https://timings.aikar.co/?id=4ab2b24cd38241d78472f4803ad56fa2#plugins
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
Comment by Geitenijs
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)
Comment by Geitenijs
Ah okay, that sounds good! Thanks for your support lately :)
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.
Comment by Geitenijs
Looking good so far!
https://timings.aikar.co/?id=21370b2769a54fab831de63e82e55caf#plugins
http://paste.enginehub.org/KCXC7u.profile
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)