Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
Testing Sling Mock 3.4.18
Description
I did some profiling on my company's slow-running unit tests today, and found that 70+% of the CPU time is spent inside NodeTypeDefinitionScanner, more specifically in the commit() call triggered by it. Our test classpath includes AEM Mocks and the Cloud SDK, resulting in 30+ CND files being detected, and as many commits done preparing the repository before each test. (Slightly more, because some commits fail and get retried later.)
It should be possible to parse each CND into memory structures in a separate pass, then create the node types all at once in a single commit. This wouldn't just eliminate the extra commits, but would also remove the need to retry, since all dependencies would also be provided in the same call.
Attachments
Issue Links
- links to
I have already made some experimental changes on this today, and my unit tests complete noticeably faster with my tentative improvement. I will open a PR today or tomorrow with the proposed changes.