-
-
Notifications
You must be signed in to change notification settings - Fork 990
feat: Add option to disable parallel build #2725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
{ | ||
logger.WriteLineHeader($"// ***** Building {buildPartitions.Length} exe(s): Start *****"); | ||
|
||
var buildLogger = buildPartitions.Length == 1 ? logger : NullLogger.Instance; // when we have just one partition we can print to std out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just use logger
directly since it's sequential.
|
||
return buildResults; | ||
|
||
static string GetFormattedDifference(ClockSpan before, ClockSpan after) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull this local function out so both build functions can use it instead of copy-paste.
@AndreyAkinshin @adamsitnik It's ok to use |
@@ -88,7 +88,11 @@ internal static Summary[] Run(BenchmarkRunInfo[] benchmarkRunInfos) | |||
|
|||
var buildPartitions = BenchmarkPartitioner.CreateForBuild(supportedBenchmarks, resolver); | |||
eventProcessor.OnStartBuildStage(buildPartitions); | |||
var buildResults = BuildInParallel(compositeLogger, rootArtifactsFolderPath, buildPartitions, in globalChronometer, eventProcessor); | |||
|
|||
bool useParallelBuild = !supportedBenchmarks.Any(x => x.Config.Options.IsSet(ConfigOptions.DisableParallelBuild)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be better to split the parallelizable builds from the sequential builds and run them both.
var parallelBenchmarks = supportedBenchmarks.Where(x => !x.Config.Options.IsSet(ConfigOptions.DisableParallelBuild));
var sequentialBenchmarks = supportedBenchmarks.Where(x => x.Config.Options.IsSet(ConfigOptions.DisableParallelBuild));
That will also make it easier for the validation step (#2676).
@timcassell it's OK |
This PR intended to fix #2721
What's changed in this PR
DisableParallelBuild
flag toConfigOptions
.BenchmarkRunnerClean::Run
.2.1. Add
BuildSequential
method that build project in sequentially.2.2. Add logics to check
DisableParallelBuild
option. If any of benchmarks containsDisableParallelBuild
flag. Use sequential build path instead of parallel build path.Test
I've manually confirmed that
sequential build
path is called when specifyingWithOptions(ConfigOptions.DisableParallelBuild);
on benchmark config.