Labels: medium, performance, disk-io, lag
Description
New ShopManager and ShopMenu objects are created repeatedly. Every ShopManager constructor attempts to load shops.json.
Common operations such as opening menus and executing commands can therefore cause repeated synchronous file reads on the server thread.
Impact
On servers with many players or large shop configurations, this can cause:
- Increased disk I/O.
- Slower menu opening.
- Main-thread stalls.
- Lag spikes during command usage.
- Unnecessary object allocation.
Expected behavior
Keep one shared in-memory shop state.
Read the configuration only during plugin startup or an explicit reload, and update the in-memory state directly after validated changes.
Labels: medium, performance, disk-io, lag
Description
New
ShopManagerandShopMenuobjects are created repeatedly. EveryShopManagerconstructor attempts to loadshops.json.Common operations such as opening menus and executing commands can therefore cause repeated synchronous file reads on the server thread.
Impact
On servers with many players or large shop configurations, this can cause:
Expected behavior
Keep one shared in-memory shop state.
Read the configuration only during plugin startup or an explicit reload, and update the in-memory state directly after validated changes.