[ https://issues.apache.org/jira/browse/OAK-6172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15996720#comment-15996720 ]
Alex Parvulescu commented on OAK-6172: -------------------------------------- !AddMembersTest-profile.png! > SecurityProviderImpl could cache the configuration set > ------------------------------------------------------ > > Key: OAK-6172 > URL: https://issues.apache.org/jira/browse/OAK-6172 > Project: Jackrabbit Oak > Issue Type: Improvement > Components: core, security > Reporter: Alex Parvulescu > Attachments: AddMembersTest-profile.png, OAK-6172.patch > > > This is about the {{SecurityProviderImpl#getConfigurations}} [0] method. > This seems to be called for each commit [1], and for the {{AddMembersTest}} > benchmark can take as much as 10% of the duration [1]. > I propose to cache this set during init and reuse it. tested this against the > benchmark and got the following: > * eager config > {noformat} > # AddMembersTest C min 10% 50% 90% max > N > Oak-Segment-Tar 1 3 3 4 4 311 > 11271 > {noformat} > * lazy config > {noformat} > # AddMembersTest C min 10% 50% 90% max > N > Oak-Segment-Tar 1 3 3 4 4 374 > 10842 > {noformat} > [0] > https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/SecurityProviderImpl.java#L134 > [1] > {noformat} > at java.util.HashSet.add(HashSet.java:219) > at > org.apache.jackrabbit.oak.security.SecurityProviderImpl.getConfigurations(SecurityProviderImpl.java:136) > at > org.apache.jackrabbit.oak.core.MutableRoot.getCommitHook(MutableRoot.java:276) > at org.apache.jackrabbit.oak.core.MutableRoot.commit(MutableRoot.java:249) > at > org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.commit(SessionDelegate.java:347) > at > org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.save(SessionDelegate.java:494) > at > org.apache.jackrabbit.oak.jcr.session.SessionImpl$8.performVoid(SessionImpl.java:419) > at > org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.performVoid(SessionDelegate.java:274) > at > org.apache.jackrabbit.oak.jcr.session.SessionImpl.save(SessionImpl.java:416) > at > org.apache.jackrabbit.oak.benchmark.AddMembersTest.addMembers(AddMembersTest.java:188) > at > org.apache.jackrabbit.oak.benchmark.AddMembersTest.runTest(AddMembersTest.java:173) > {noformat} -- This message was sent by Atlassian JIRA (v6.3.15#6346)