diff --git a/build/build-perf-scenarios.yml b/build/build-perf-scenarios.yml index 9843fd4a4..53f196c61 100644 --- a/build/build-perf-scenarios.yml +++ b/build/build-perf-scenarios.yml @@ -15,11 +15,10 @@ parameters: - displayName: "Build - BlazorWasm" arguments: --scenario blazorwasm $(buildJobs) --property scenario=BlazorWasm - # Skip https://github.com/dotnet/aspnetcore/issues/49760 - # - displayName: "Build - BlazorWasm (Hosted)" - # arguments: --scenario blazorwasm-hosted $(buildJobs) --property scenario=BlazorWasmHosted - # - displayName: "Build - BlazorServer" - # arguments: --scenario blazorserver $(buildJobs) --property scenario=BlazorServer + - displayName: "Build - BlazorWasm (Hosted)" + arguments: --scenario blazorwasm-hosted $(buildJobs) --property scenario=BlazorWasmHosted + - displayName: "Build - BlazorServer" + arguments: --scenario blazorserver $(buildJobs) --property scenario=BlazorServer - displayName: "Build - MVC" arguments: --scenario mvc $(buildJobs) --property scenario=MVC - displayName: "Build - API" diff --git a/src/BenchmarksApps/BuildPerformance/BlazorServerScenario.cs b/src/BenchmarksApps/BuildPerformance/BlazorServerScenario.cs index 2d05a8733..82d181a94 100644 --- a/src/BenchmarksApps/BuildPerformance/BlazorServerScenario.cs +++ b/src/BenchmarksApps/BuildPerformance/BlazorServerScenario.cs @@ -19,7 +19,7 @@ public BlazorServerScenario(DotNet dotnet) public async Task RunAsync() { - await _dotnet.ExecuteAsync($"new blazor --use-server"); + await _dotnet.ExecuteAsync($"new blazor -int Server"); await Build(); @@ -35,9 +35,6 @@ public async Task RunAsync() // No-Op build await NoOpBuild(); - // Changes to a .cshtml file - await ModifyCshtmlFile(); - // Rebuild await Rebuild(); } @@ -68,7 +65,7 @@ async Task ChangeCSFile() async Task ChangeToRazorMarkup() { - var indexRazorFile = Path.Combine(_workingDirectory, "Components", "Pages", "Index.razor"); + var indexRazorFile = Path.Combine(_workingDirectory, "Components", "Pages", "Home.razor"); File.AppendAllText(indexRazorFile, Environment.NewLine + "

New content

"); var buildDuration = await _dotnet.ExecuteAsync("build --no-restore"); @@ -117,20 +114,5 @@ async Task AddParameterToComponent() buildDuration.TotalMilliseconds, "Add a parameter to .razor"); } - - async Task ModifyCshtmlFile() - { - var file = Path.Combine(_workingDirectory, "App.razor"); - var originalContent = File.ReadAllText(file); - - File.WriteAllText(file, originalContent.Replace("", "

Some text

")); - - var buildDuration = await _dotnet.ExecuteAsync("build --no-restore"); - - MeasureAndRegister( - "blazorserver/razor-change-cshtml", - buildDuration.TotalMilliseconds, - "Change .cshtml file markup"); - } } } diff --git a/src/BenchmarksApps/BuildPerformance/BlazorWasmHosted.cs b/src/BenchmarksApps/BuildPerformance/BlazorWasmHosted.cs index 198736962..beb773747 100644 --- a/src/BenchmarksApps/BuildPerformance/BlazorWasmHosted.cs +++ b/src/BenchmarksApps/BuildPerformance/BlazorWasmHosted.cs @@ -9,6 +9,8 @@ namespace Build { class BlazorWasmHosted { + private const string ProjectName = "BlazorApp"; + private readonly DotNet _dotnet; private readonly string _workingDirectory; private readonly string _serverDirectory; @@ -18,19 +20,16 @@ public BlazorWasmHosted(DotNet dotNet) { _dotnet = dotNet; _workingDirectory = dotNet.WorkingDirectory; - _serverDirectory = Path.Combine(_workingDirectory, "Server"); - _clientDirectory = Path.Combine(_workingDirectory, "Client"); + _serverDirectory = Path.Combine(_workingDirectory, ProjectName); + _clientDirectory = Path.Combine(_workingDirectory, $"{ProjectName}.Client"); } public async Task RunAsync() { - await _dotnet.ExecuteAsync($"new blazor --use-wasm"); + await _dotnet.ExecuteAsync($"new blazor -n {ProjectName} -o . -int WebAssembly"); await Build(); - // Change - await ChangeShared(); - // Changes to .razor file markup await ChangeClient(); @@ -67,23 +66,9 @@ async Task ChangeServer() "Change a file in Server"); } - async Task ChangeShared() - { - // Changes to .cs file - var csFile = Path.Combine(_workingDirectory, "Shared", "WeatherForecast.cs"); - File.AppendAllText(csFile, Environment.NewLine + "// Hello world"); - - var buildDuration = await _dotnet.ExecuteAsync("build --no-restore", _serverDirectory); - - MeasureAndRegister( - "blazorwasm-hosted/shared-file", - buildDuration.TotalMilliseconds, - "Change a file in shared"); - } - async Task ChangeClient() { - var indexRazorFile = Path.Combine(_clientDirectory, "Pages", "Index.razor"); + var indexRazorFile = Path.Combine(_clientDirectory, "Pages", "Counter.razor"); File.AppendAllText(indexRazorFile, Environment.NewLine + "

New content

"); var buildDuration = await _dotnet.ExecuteAsync("build --no-restore", _serverDirectory);