Optiomization | Permission system

Discussion in 'Spigot Discussion' started by hrzn00, Jul 11, 2021.

  1. Hello there

    I was wondering if there is a notable performance difference on how I structure permissions:
    All permissions will be handled by LuckPerms but I'm guessing depending on how extensive the changes to permissions are, the filtering or rather the checks must take longer, right? Or how does a plugin like that check for permissions? Does it just go through an endless if/then or elseif loop? Does it use some sort of regex to narrow the searchresults? Anyways, these would be the options:

    Option a would be to have 1 simple "player" group and then individualy add permissions on each rankup aka completion of missions to unlock stuff


    Option b would be to have multiple clearly defined groups and only add as few as possible permissions to the player itself and instead move him up and down in the group-tree

    what would be more power-efficient? (I'm currently working on optimizing my server and yes, I'm that nitpicky)
  2. Using groups to add permissions is much better in my opinion (and I think many will agree with me) - it's much more organized and saves you the headache of adding every single permission to a player when needed.
    Performance-wise I don't think there's much difference (maybe 1 pico/nanosecond - overall).
    Also don't get too nitpicky - you'll end up "gaining" 0.00001 TPS but a lot of headache trying to optimize and maintain the "performance boost".