Back in the old days, PEX and other permission managers tended to have a really bad performance on *ukkit servers for things like ‘prison servers’ where most folks had ranks A-Z as an inheritance chain and in fact “inheritance chaining” was the cause of bad peformance (that and the wildcarding)
While such a complex system will always require more than a simple player/mod/admin configuration anyways, my question is if the new Sponge core system, and PEX core, is able to handle inheritance chains much better now or is just as bad or even worse off than before?
Thanks for prompt reply. The codeskillz in that pastebin are many levels above my ability to comprehend esp since I am very unfamilar with pex’s infrastructure and systems in the first place.
Can you explain what is meant by baking and flattening the inheritance?
I’m not 100% familiar with pex’s code. But you mentioned that you expected that long inheritance would end up being slow right?
So you are expecting a lookup to Z->Y->X->…->A right?
So if you know you need to be performant, you can do all the lookups at once, at the start, so you would only need to check Z and not fallback to Y, since the data hasn’t been changed you can rely on it to be correct.
e.g.
A {
permission.x = true;
}
B inherits A {
permission.y = true;
}
C inherits B {
permission.z = true;
}
Understand? Of course in practise it’s more complicated, because you have to decide when to “re-bake” when permissions are changed, as well as working out how to deal with contexts etc.
ahkay so its like… for our readability and design, we structure with inheritance … but under the hood, it treats it just like a pastebin-from-hell redundancy…
If thats how it did it before as well, then I guess the problem comes in when you have lots and lots of ranks and a couple new permissions each time, and just wind up with a massive datastructure to store in memory. Unless that is not how it was done before, and the flattening is new and performance strong…
PEX’s inheritance calculation has been entirely redesigned for 2.x, so in theory it shouldn’t have the same performance issues. I think people have already started setting up long inheritances and it’s fine? Either way, there shouldn’t be a huge performance difference since PEX caches the results of lookups for a specific context.