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

angela commented on OAK-1046:
-----------------------------

hi tom

thanks for the patch. i am sure that we will need to add some sort of caching.
regarding the readstatus cache you propose this rather go into 
CompiledPermissionsImpl which also has the possibilty to detect if the cache is 
stale.

apart from that the readstatus calculation you mention is covered by OAK-774.

imo another possible way to improve performance of permission evaluation was to 
share evaluated permissions and maybe caches between sessions with the same 
principal set and the same state of the permission store.

> Faster anonymous read operations
> --------------------------------
>
>                 Key: OAK-1046
>                 URL: https://issues.apache.org/jira/browse/OAK-1046
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>            Reporter: Thomas Mueller
>         Attachments: OAK-1046-test-1.patch
>
>
> The oak-run test GetNodeWithAnonymous is currently quite a bit slower than 
> GetNodeWithAdmin. According to my profiling data, the main bottleneck is 
> SecurityContext.getReadStatus, which calls PermissionProvider.getReadStatus 
> which calls CompiledPermissionImpl.getReadStatus.
> To improve performance, I tried caching the result of this call, using a 
> simple hash map, with a string key (tree.getPath() + property.getName()). 
> This improved performance to now:
> {code}
> java -Dwarmup=5 -Druntime=30 -jar target/oak-run-*.jar benchmark 
> GetNodeWithAnonymous Oak-Tar
> packages:
> 39%: org.apache.jackrabbit.oak.plugins.segment
> 23%: org.apache.jackrabbit.oak.core
> 14%: org.apache.jackrabbit.oak.plugins.memory
> 6%: org.apache.jackrabbit.oak.namepath
> 4%: com.google.common.collect
> 4%: org.apache.jackrabbit.oak.jcr.session
> 3%: org.apache.jackrabbit.oak.util
> .
> Oak-Tar                          142     144     146     148     218     203
> java -Dwarmup=5 -Druntime=30 -jar target/oak-run-*.jar benchmark 
> GetNodeWithAdmin Oak-Tar
> packages:
> 29%: org.apache.jackrabbit.oak.plugins.segment
> 17%: org.apache.jackrabbit.oak.plugins.memory
> 17%: org.apache.jackrabbit.oak.namepath
> 12%: org.apache.jackrabbit.oak.jcr.session
> 8%: org.apache.jackrabbit.oak.util
> 5%: org.apache.jackrabbit.oak.core
> 4%: org.apache.jackrabbit.oak.plugins.segment.file
> .
> Oak-Tar                           35      35      36      37      73     818
> {code}
> So it is still about 4 times slower, but it's an improvement (currently it is 
> 10 times slower).
> I wonder if there is a better way. I'm don't think caching the ReadStatus on 
> a property or node level is very memory efficient, but maybe other solutions 
> would be very hard to implement.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to