dotnet / dotnet/aspnetcore

Benchmark and improve shared `RequestDelegateCreation` test infrastructure

Open
#47,907 3 comments 0 reactions 0 assignees View on GitHub
area-minimal feature-rdg
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

The RequestDelegateGenerator uses Roslyn's testing APIs to validate the compile time and runtime behavior of RDG-enabled apps in tests.

As part of the work to share tests between the two implementations, we migrated RDF tests to use the same infrastructure.

The benefit of shared testing infrastructure comes with some downsides as we migrate more tests to the shared infrastructure. Some ideas that we can consider to improve test perf:

- Use a single shared compilation for all unit tests with a unique source file per test
- Remove unneeded baseline asserts to avoid the read/write of baseline text files
- Move the loading of symbols for generated code behind a developer enabled flag like `RegenerateBaselines`

Update: profiling locally suggests that we can save a fair bit by avoiding the multiple calls to `GetCompilationAsync` and the loading of assembly references into the compilation.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.