You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Alex Parvulescu (JIRA)" <ji...@apache.org> on 2017/05/04 13:19:04 UTC

[jira] [Commented] (OAK-6172) SecurityProviderImpl could cache the configuration set

    [ https://issues.apache.org/jira/browse/OAK-6172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15996710#comment-15996710 ] 

Alex Parvulescu commented on OAK-6172:
--------------------------------------

[~anchela] what do you think?

> 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
>
> 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)