ChestShop-authors / ChestShop-3

ChestShop - the chest & sign shop plugin for Minecraft Servers running Bukkit/Spigot/Paper
https://dev.bukkit.org/projects/chestshop
GNU Lesser General Public License v2.1
277 stars 179 forks source link

Start-up initialization optimizations. #53

Open mibby opened 7 years ago

mibby commented 7 years ago

ChestShops dev 12

Is there anything that can be done to improve start-up time initialization? Currently it takes and slows down start-up by ~3 seconds and seems to grow over time.

[11:16:47] [Server thread/INFO]: [ChestShop] Enabling ChestShop v3.8.13-SNAPSHOT (build #12)
[11:16:50] [Server thread/INFO]: [ChestShop] LWC version 4.6.0-SNAPSHOT loaded.
[11:16:50] [Server thread/INFO]: [ChestShop] Vault loaded! Found an economy plugin!
Phoenix616 commented 7 years ago

That's strange, can you provide some more info about your setup as I can't seem to reproduce it. Neither on a new setup nor on an existing one.

mibby commented 7 years ago

Hm, I'm not too sure why it took so long to initialize. As of the latest restart, it doesn't seem to have taken as long.

[21:00:45] [Server thread/INFO]: [ChestShop] Enabling ChestShop v3.8.13-SNAPSHOT (build #12)
[21:00:45] [Server thread/INFO]: [ChestShop] LWC version 4.6.0-SNAPSHOT loaded.
[21:00:45] [Server thread/INFO]: [ChestShop] Vault loaded! Found an economy plugin!

Though in a slightly few day older log, it did take over a second.

[09:00:48] [Server thread/INFO]: [ChestShop] Enabling ChestShop v3.8.13-SNAPSHOT (build #12)
[09:00:49] [Server thread/INFO]: [ChestShop] LWC version 4.6.0-SNAPSHOT loaded.
[09:00:49] [Server thread/INFO]: [ChestShop] Vault loaded! Found an economy plugin!

What would you like to know about the setup?

Phoenix616 commented 7 years ago

Well some stuff that would be interesting is whether or not you are using the database logging and how much content your items.db and users.db contain. Also if any other plugin (especially LWC and LWC-hooking ones) take longer than expected to load.

mibby commented 7 years ago

I don't use the built-in ChestShops logging.

LOG_TO_FILE: false
#If true, plugin will log transactions in its own file
LOG_TO_CONSOLE: false
#Do you want ChestShop's messages to show up in console?

Nor do I use the LWC hooks.

PROTECT_CHEST_WITH_LWC: false
#Do you want to protect shop chests with LWC?
PROTECT_SIGN_WITH_LWC: false
#Do you want to protect shop signs with LWC?
REMOVE_LWC_PROTECTION_AUTOMATICALLY: false
#Should the chest's LWC protection be removed once the shop sign is destroyed? 

Config. http://paste.ubuntu.com/25023510/

But I do use ChestShopNotifier and various other database logging unrelated to ChestShops such as LWC, logblock, player analytics, etc. The items and user.db files generally stay around 1MB in size. I occasionally delete them once every few months to keep the sizes in check.

DB files. https://www.dropbox.com/s/00nvzemxf0nwcv0/db.rar?dl=1

Phoenix616 commented 7 years ago

Hm, well that doesn't sound like that could be the source of the issue then. I'll definitely keep an eye on that but until I can reproduce the issue it's really difficult to attempt to fix it.

I occasionally delete them once every few months to keep the sizes in check.

Unless you also remove all ingame shops too I highly advise against doing so. You would break all shops that use ids of items with meta data and of players with special short names.

mibby commented 7 years ago

of players with special short names.

Perhaps but I am forced to reset the user.db file because players who change their name, their old shops no longer work. Unless this was recently fixed with the UUID name manager, this was always something I've had to do to resolve the issue.

Phoenix616 commented 7 years ago

players who change their name, their old shops no longer work

This is fixed in the latest builds with the new v3 NameManager.

mibby commented 7 years ago

Would it be possible to add debug to the entire start-up initialization of ChestShops to see what it hangs on or why?