Skip to content

Optimize command lowercasing in ZCommandManager and cooldown lookup in ZUser - #248

Merged
Maxlego08 merged 1 commit into
Maxlego08:developfrom
Smorki:perf/command-hoisting-and-cooldown-lookup
Sep 19, 2026
Merged

Maxlego08 merged 1 commit into
Maxlego08:developfrom
Smorki:perf/command-hoisting-and-cooldown-lookup

Conversation

@Smorki

@Smorki Smorki commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

This PR includes two minor hot-path performance improvements:

  1. ZCommandManager: Hoisted cmd.getName().toLowerCase() out of the command execution loop to avoid allocating identical lowercased Strings on every command iteration.
  2. ZUser: Replaced double map lookups (containsKey + get) in isCooldown with a single get() lookup.

@Maxlego08
Maxlego08 changed the base branch from main to develop September 19, 2026 14:04
@Maxlego08
Maxlego08 merged commit a078a45 into Maxlego08:develop Sep 19, 2026
3 checks passed
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.

2 participants