-
Notifications
You must be signed in to change notification settings - Fork 71
Open
Labels
kind/featureCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.triage/acceptedIndicates an issue or PR is ready to be actively worked on.Indicates an issue or PR is ready to be actively worked on.
Description
Motivation
When using ArchUnitNET in large .NET solutions with many assemblies, running architecture tests in CI pipelines can become very slow.
Currently, ArchLoader().LoadAssemblies(...).Build() always scans assemblies from scratch on every test run.
In ArchUnit for Java, this problem was solved by introducing a caching layer for the imported architecture model. This significantly reduced execution time by avoiding redundant scanning when assemblies did not change.
Proposal
Introduce a caching mechanism in ArchUnitNET core:
- In-memory cache: Reuse the already loaded
Architecturemodel within the same test run. - Persistent cache: Serialize the
Architectureobject to disk and reload it in subsequent runs, if assemblies have not changed.
Cache invalidation
The cache should be invalidated if:
- An assembly file has changed (e.g. hash or timestamp).
- ArchUnitNET version changes (internal model may not be compatible).
- [Optional] Additional cache key provided by user.
Benefits
- Greatly improves performance in CI/CD pipelines for large solutions.
- Aligns ArchUnitNET with the Java version, which already supports caching.
- Reduces feedback time for developers running tests locally.
fossbrandon
Metadata
Metadata
Assignees
Labels
kind/featureCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.triage/acceptedIndicates an issue or PR is ready to be actively worked on.Indicates an issue or PR is ready to be actively worked on.