Closed ErikSzabo closed 4 months ago
I'm still trying out stuff from the luckperms API to possible make this even faster, so I converted this to draft. I will convert it back when I'm finished with experimentation.
You don't need to add the dependency in build.gradle.kts in the bukkit module because it's already included in the common module.
If you use LuckPerms as the permission manager (which I assume most of the servers do), you can now use a cache for effective multiplier permissions. Cache will recalculate when user/group gets or loses permission. This happens async. Only the first call will cause a cache calculation sync.
For lookup times it is like ~17 times faster even for an average luckperms database.
Benchmark results
This benchmark shows the total time elapsed to calculate the multiplier.
This is with an avg permission database OG Method avg:
178,968 ns
LP Hook avg:10,230 ns
This is with a small permission database (OPs in discord) OG Method avg:
45,299 ns
LP Hook avg:8,629 ns