Skip to content

Repeated ShopManager creation causes unnecessary synchronous disk I/O #18

Description

@CYooBin10

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions