Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Security] Make AccessDecisionManager much faster#49670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Nyholm commentedMar 11, 2023
I spent 3 hours last night considering if I should make this PR or not. I slept on it but still couldn't understand the why I got so massive performance gain... It turns out that I had xdebug on while debugging 🤦🏽 When I re-ran the profiles it turns out they are pretty much the same. I dont think this complexity is worth the almost non existent gain. |
When you are using a lot of voters, you need better caching. With inspiration from#43066 by@jderusse I managed to squeeze some more performance from the
AccessDecisionManager.I do about 7000 calls to
AccessDecisionManager::getVoters(). It takes me 369ms.With this PR, it takes about 30ms.
The trick is that I don't loop over all Voters all the time. If I seen the object and attribute before then I just returns the voters I previously calculated.
Performance:
When do benchmark on an application with 40 voters I got:
I would love a few more set of eyes on this PR.