Flush output only at outer render boundaries - #978
Closed
sebastienros wants to merge 1 commit into
Closed
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Owner
Author
|
Closing because this performance work is investigatory only; the benchmark branch remains available. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
IFluidTemplate.RenderAsync(IFluidOutput, ...)flush contractrender,render for, andincludeoperations through the no-flush path; source-generated child templates use an equivalent generated coreMaxOutputSizecumulative by establishing theLimitedFluidOutputonce at public extension boundariesBenchmark
BenchmarkDotNet 0.15.8 ShortRun, .NET 10.0.10, Apple M4 Pro. The benchmark uses a reusable counting
IFluidOutput; allocations are unchanged.renderrender for(100 items)The no-op counting output intentionally understates the benefit for streaming outputs where each flush performs I/O. The single-child result is slightly slower; the loop workload improves while eliminating 100 output-boundary operations.
Command:
RestoreSources=https://packagefeedproxy.microsoft.io/nuget/v3/index.json dotnet run -c Release --no-restore --project Fluid.Benchmarks -- --filter '*NestedRenderBenchmarks*' --job shortGenerated BenchmarkDotNet artifacts were not committed.
Validation
/p:Compiled=true: 5 passed in each modedotnet test --no-restore: 2,750 passed, 20 skippeddotnet test --no-restore /p:Compiled=true: 2,750 passed, 20 skippeddotnet build Fluid/Fluid.csproj -c Release --no-restore: all target frameworks passed, includingnetstandard2.0The required NuGet proxy did not yet contain pinned
xunit.v3.mtp-v24.0.0, so local test restore used the proxy's nearest4.0.0-pre.154via an external temporary MSBuild props file. No feed or dependency changes were written to the repository.