Skip to content

v2.7.3 - Performance Fix & LuckPerms H2 Migration

Choose a tag to compare

@derrickmehaffy derrickmehaffy released this 05 Mar 23:09
· 169 commits to main since this release

Performance Fix & LuckPerms H2 Migration

This release includes a critical performance fix and completes LuckPerms H2 database migration support.


Performance Fix

Cache Bypass Fix in Permission Checks

Fixed a critical performance issue where HyperPermsPermissionSet.contains() was bypassing the Caffeine permission cache, triggering a full permission resolution on every call. This was consuming 6.5% CPU in profiling.

Technical Details:

  • Added checkPermission() method to HyperPerms that returns TriState and properly uses the cache
  • Refactored HyperPermsPermissionSet.contains() to use the cached lookup instead of calling resolver directly
  • Removed redundant getOrLoadUser() private method

Performance Impact:

  • Before: Every contains() call triggered full resolve() - O(n groups * m nodes)
  • After: Cache hit = O(1) lookup; cache miss = resolve + cache store
  • Expected 90%+ reduction in CPU time for permission checks

LuckPerms H2 Migration Support

Command Syntax Update

Due to Hytale command framework limitations, migration options now use dash-separated syntax:

/hp migrate luckperms-confirm-verbose

H2 Database Reader Enhancements

  • Dynamically loads H2 driver from LuckPerms libs/ folder for version compatibility
  • Handles locked databases by creating temporary copies
  • Fixed connection URL to use absolute paths (required by H2 2.1.x+)
  • Set thread context classloader for proper class isolation
  • H2 is now compileOnly to avoid version conflicts with bundled driver

Storage Detection Improvements

  • Fixed path resolution to correctly find LuckPerms in /mods/ folder
  • Case-insensitive folder name detection (finds LuckPerms_LuckPerms, etc.)
  • Flexible pattern matching for database files
  • Support for various LuckPerms folder naming conventions

Windows Support

  • Added clear error message for Windows file locking issues
  • Users are directed to stop LuckPerms before migrating when database is locked

Upgrade Notes

  • Drop-in replacement for v2.7.0
  • No configuration changes required
  • Fully backwards compatible

Full Changelog: HyperSystemsDev/HyperPerms@v2.7.0...v2.7.3

Discord: https://discord.gg/SNPjyfkYPc