Thomas Mueller created OAK-1046: ----------------------------------- Summary: 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
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 is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira