[
https://issues.apache.org/jira/browse/SLING-12266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17836054#comment-17836054
]
Stefan Seifert commented on SLING-12266:
----------------------------------------
i tested both PRs locally with the unit tests from aem-mock (which runs all
tests on all resource resolver types), and it again was a considerable
improvement in run time (from 45s to 32s on my machine). i did not see any
difference with and without
[https://github.com/apache/sling-org-apache-sling-testing-sling-mock-oak/pull/12/commits/11de72022bf969e7253c6f6725b528963d3638db,]
so i recommend to remove this optimization again - it seems oak is smart
enough to not re-register the CND files again or it does not make a difference.
concerning the latest jackrabbit/oak versions: we have an eye on this, but as
described in SLING-12208 we have to maintain a wide range of compatibility for
project contexts these mocks are used. esp. if used in AEM 6.x context, a very
old oak version is still in use, and we have to support this. that's why we
cannot always update to latest and greatest in the mocks here.
> Cache initial repository state to improve JCR_OAK performance
> -------------------------------------------------------------
>
> Key: SLING-12266
> URL: https://issues.apache.org/jira/browse/SLING-12266
> Project: Sling
> Issue Type: Improvement
> Components: Testing
> Affects Versions: Testing Sling Mock 3.4.18
> Reporter: Csaba Varga
> Assignee: Stefan Seifert
> Priority: Minor
>
> A lot of effort goes into preparing an Oak Mock repository from scratch: node
> types need to be registered, indexes need to be created, and all this happens
> over several commits. None of this work depends on the test case itself, so
> it will always result in the exact same repository state. We could take the
> root NodeState from the first repository we build, then build subsequent
> repositories on top of it, avoiding most of the redundant work. Commits can
> be relatively expensive even in memory, so each one we avoid can save a lot
> of time in the long term.
>
> This would require extending the contract between Testing Sling Mock and the
> ResourceResolverTypeAdapters, to add optional "make snapshot" and "build repo
> from snapshot" operations. For adapters that don't support them, we would
> keep rebuilding things from scratch.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)