Skip to content

perf: reduce command map iteration and avoid redundant cache puts#6526

Open
1wairesd wants to merge 7 commits intoEssentialsX:2.xfrom
1wairesd:2.x
Open

perf: reduce command map iteration and avoid redundant cache puts#6526
1wairesd wants to merge 7 commits intoEssentialsX:2.xfrom
1wairesd:2.x

Conversation

@1wairesd
Copy link
Copy Markdown
Contributor

  • AlternativeCommandsHandler: add addPlugins() for bulk registration in
    a single pass over known commands (O(plugins*commands) -> O(commands));
    extract registerPluginCommands() shared by both addPlugin/addPlugins
  • Settings.reloadConfig: use addPlugins() instead of per-plugin loop
  • ModernUserMap.getUser(Player): skip loadUncachedUser/put when player
    is already cached with the same Player instance

1wairesd and others added 7 commits October 26, 2025 14:27
- AlternativeCommandsHandler: add addPlugins() for bulk registration in
  a single pass over known commands (O(plugins*commands) -> O(commands));
  extract registerPluginCommands() shared by both addPlugin/addPlugins
- Settings.reloadConfig: use addPlugins() instead of per-plugin loop
- ModernUserMap.getUser(Player): skip loadUncachedUser/put when player
  is already cached with the same Player instance
@mdcfe
Copy link
Copy Markdown
Member

mdcfe commented Apr 28, 2026

Please fill out the PR template as requested when you opened the PR :)

You can find the appropriate templates here.

Since this is an optimisation, it would also be good if you could provide startup timings showing the real-world improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants