This repository has been archived by the owner on Jan 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
Acl::SetRule performance is very slow #4
Comments
Here is the current benchmarks running 1538 rules.
|
@steverhoades you can try patching the line you suggested, but you'd need to verify edge cases with string keys and array keys first. |
@Ocramius good point.
|
@steverhoades can work, yes. |
@steverhoades again, I'd start from the tests: the snippet above overwrites numeric keys. |
@Ocramius I should know better, I'll check out the tests. From reading the code it appears as though the keys should be resourceIds... perhaps i have that wrong. |
This repository has been closed and moved to laminas/laminas-permissions-acl; a new issue has been opened at laminas/laminas-permissions-acl#6. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
We are dealing with rules in the
70k - 100k1k - 2k range. It currently takes setRule around 2.5 seconds to process all of these rules.I have been able to increase the performance of this method by roughly 40% by simply eliminating the use of array_merge.
Suggested Change Acl line:580 to:
Suggestions on how this method can be improved further would be great appreciated. The tree that is being generated takes approximately 100-130ms to serialize/unserialize.
Note: Acl configuration will be cached in Production.
EDIT:
Sorry rules are in the 1500 - 2000 range. Roughly 300 roles and 300 resources.
The text was updated successfully, but these errors were encountered: