TNG / ArchUnitNET

A C# architecture test library to specify and assert architecture rules in C# for automated testing.
Apache License 2.0
877 stars 57 forks source link

Passing only new types to AddTypesToNamespace load task #166

Closed gbtb closed 2 years ago

gbtb commented 2 years ago

Hello.

I have found a performance problem in LoadTypesForModule method. In the case of a recursive load of multiple modules we ended up repeatedly creating AddTypesToNamespace load task for each namespace for the whole collection of types (from all assemblies). I think it should be enough to create AddTypesToNamespace task with types from current assembly only. This quick fix allows for previously ignored LoadAssembliesIncludingRecursiveDependencies test to pass in about 20 seconds. Without this fix it takes 110 seconds on my machine. Screenshot_20220803_231155

fgather commented 2 years ago

Wow, nice, good catch and thank you for the fix! I assume that issue was introduced, when we restructured the import process some years ago.