Remove redundant creation of Forwarding logger with NullLogger #10125
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
Random discovery - we create NullLogger even when we have other logger(s) registered (e.g. ConsoleLogger, TerminalLogger ...).
We need to make sure that Projcet started and finished events are being transfered - we can 'hijack' the existing registration of ConfigurableLForwardingLogger for that - we just need to inspect and adjust existing registration
Motivation
Build with just the built-in loggers (TerminalLogger, ConsoleLogger, FileLogger) is probably the most common configuration - and we are injecting extra forwarder to each such a build - so while it's likely very small savings (as only couple events was redundantly de/serialized, rest was quickly skipped) - it applies very broadly.
Perf
Following measurements were done using the OrchardCore and bootstrapped release MSBuild.exe with following 3 scenarios:
Each scenario for each branch for 3 runs after the warmup run. Clean and kill of msbuild/dotnet/vbcscompiler processes between each individual runs. Median value choosed for each scenario.
The versions that has been tested were:
Testing
Pre-existing tests