When profiling unit/integration tests I see one of the main CPU/Time contributor is DryIoc delegates compilation. Currently tests recreates and re initialize container for the every test. Basic container initialisation is always the same, the differents comes from tests who can override sode deps. So I've come up with idea that it would be great to try somehow to share the container between tests. Ideally I'l like to have a container that is initialized and all delegates compiled and then in tests create something like a scope/child container or anything, where tests could make their overrides.
The only problem is that we have some singletons, and of course singletons should be created every time for the every new test so I'm not sure how and if that is possible at all.
Ideally after the tests we need to tell container to throw out all initialized singletons and recreate them again next time reference is resolved
Thanks Regards Yahor
UPDATE: Am I right that I can achive exactly what I want if I'll be using Reuse.InCurrentScope instead of Reuse.Singleton plus will create/use new scope for the every new test?