Skip to content

Parallelize static web assets compression#54332

Draft
cl0ckt0wer wants to merge 2 commits into
dotnet:mainfrom
cl0ckt0wer:codex/staticwebassets-parallel-compression
Draft

Parallelize static web assets compression#54332
cl0ckt0wer wants to merge 2 commits into
dotnet:mainfrom
cl0ckt0wer:codex/staticwebassets-parallel-compression

Conversation

@cl0ckt0wer
Copy link
Copy Markdown

Summary

  • make Static Web Assets cache manifest writes resilient to concurrent readers/writers
  • add a bounded parallelism knob for gzip and Brotli static web asset compression
  • preserve existing Brotli compression-level properties while adding StaticWebAssetsBrotliCompressionLevel
  • make the Static Web Assets Brotli tool fail when any file compression fails

Related to dotnet/aspnetcore#64352.

Testing

  • ./build.cmd -projects test/Microsoft.NET.Sdk.StaticWebAssets.Tests/Microsoft.NET.Sdk.StaticWebAssets.Tests.csproj
  • ./.dotnet/dotnet.exe test test/Microsoft.NET.Sdk.StaticWebAssets.Tests/Microsoft.NET.Sdk.StaticWebAssets.Tests.csproj --no-build --filter FullyQualifiedName~CompressionTasksTest
  • ./.dotnet/dotnet.exe test test/Microsoft.NET.Sdk.StaticWebAssets.Tests/Microsoft.NET.Sdk.StaticWebAssets.Tests.csproj --no-build --filter FullyQualifiedName~DefineStaticWebAssetsCache_CanHandleConcurrentWriters
  • ./.dotnet/dotnet.exe test test/Microsoft.NET.Sdk.StaticWebAssets.Tests/Microsoft.NET.Sdk.StaticWebAssets.Tests.csproj --no-build --filter FullyQualifiedName~DefineStaticWebAssetsCache_CanReplaceManifestWhileReadersShareDelete
  • ./build.cmd -projects src/StaticWebAssetsSdk/Tool/Microsoft.NET.Sdk.StaticWebAssets.Tool.csproj
  • Static Web Assets tool smoke tested invalid max degree of parallelism and missing source-file failures return non-zero

@github-actions github-actions Bot added the Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, StaticWebAssetsSDK label May 15, 2026
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Thanks for your PR, @cl0ckt0wer.
To learn about the PR process and branching schedule of this repo, please take a look at the SDK PR Guide.

@cl0ckt0wer
Copy link
Copy Markdown
Author

@dotnet-policy-service agree

@cl0ckt0wer
Copy link
Copy Markdown
Author

Hi team, thanks for taking the time out of your day to work on this. I've been running a lot of builds locally and this would save a lot of frustration. So here's the analysis of the failures:

  • linux x64 TestBuild failed copying Microsoft.TemplateEngine.Utils.dll due to an IOException/file-in-use error in Microsoft.Common.CurrentVersion.targets.
  • macOS arm64 TestBuild failed a Helix work item for Microsoft.CodeAnalysis.NetAnalyzers.UnitTests with 0 tests executed under the selected filter.

Neither failure appears to involve Static Web Assets or the compression changes in this PR. Could someone please rerun the failed legs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, StaticWebAssetsSDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant