Skip to content

Releases: 1wairesd/CommandGuard

perf: major optimization of tab/command system and config access

Choose a tag to compare

@1wairesd 1wairesd released this 21 May 17:24

Replaced O(n²) logic with HashSet-based lookups, removed repeated config access, and optimized command/tab processing paths.

Key improvements:

  • Replaced List.contains with HashSet in tab filtering
  • Optimized getExtendsTabCommands from O(n²) to Set-based approach
  • Cached is_network config to avoid repeated getBoolean calls
  • Replaced reflection-based Sound lookup with direct valueOf
  • Replaced addUnique with LinkedHashSet-based merging
  • Made plugin message handling more efficient
  • Reduced repeated string parsing and allocations in hot paths
  • Improved async update checker to CompletableFuture-based execution
  • Replaced HashMap with ConcurrentHashMap where needed

Overall: reduced CPU overhead in hot events (TAB, commands, messaging) and improved thread safety.