Improving the performance of custom injectors in automated unit tests?
We're currently using unit tests with AEM Mock to test our models in our application. We've recently introduced a custom injector and custom annotations and this has been bogging down the tests significantly. Even in tests that don't do any work, merely injecting the custom injector adds a half second or more of startup time. Is there a way to improve the performance this? My understanding based on this question and the answer is that each custom injector is forced to interrogate every Inject annotation of every model registered in the system at startup. Is that understanding correct? It's possible that there's no way to speed this up, but I wanted to make sure we weren't missing something. If this is the case and each new AEM Context will simply have to apply the injector to every model with an Inject annotation, then I can't see a way to improve this outside of shunting these tests off to an Integration test suite or something like that.
We were hoping there was an ability to hint the AEM Context in the mock to only read certain models. Or maybe in the custom injector implementation is there a way to scope down which annotations the custom injector reads. Can someone let me know if I'm missing something?