Reduce render argument allocations - #979
Closed
sebastienros wants to merge 1 commit into
Closed
Conversation
Store the common one- and two-argument render cases inline and use cleared pooled storage for larger argument sets while preserving caller-side evaluation and callback ordering. Add focused callback cleanup coverage and a two-argument benchmark. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: ed283205-128c-47d0-874c-2f48e363bdf8
sebastienros
changed the base branch from
sebros/flush-outer-render-boundary
to
main
August 19, 2026 03:39
sebastienros
force-pushed
the
sebros/reduce-render-scope-allocations
branch
from
August 19, 2026 03:39
a61c782 to
caaeb4f
Compare
Owner
Author
|
Closing because this performance work is investigatory only; commit caaeb4f remains available on the branch for traceability. |
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.
The scope-management rewrite merged in #981 already removes the redundant render scope allocation. Named render arguments still allocate a temporary
KeyValuePair[]on every execution, even though most calls pass only one or two arguments.Approach
FluidValue[]storage only for three or more arguments and return it on both success and failure.Assignedcallback in the caller scope before publishing any argument into the isolated render scope.Benchmark
BenchmarkDotNet 0.15.8, .NET 10.0.11 Arm64, Apple M4 Pro, in-process toolchain, 3 warmup and 5 measurement iterations:
origin/mainThe timing confidence intervals overlap (198.3-216.1 ns baseline and 207.8-216.5 ns after), so this is treated as allocation-neutral throughput rather than a speed improvement. A pool-only two-argument version measured 218.5 ns / 688 B; inline storage was retained for the common case, with pooling reserved for larger argument sets.
Validation
dotnet test --no-restore: 2,750 passed, 20 skipped, 0 faileddotnet test --no-restore /p:Compiled=true: 2,750 passed, 20 skipped, 0 failedFluid: netstandard2.0, net8.0, net9.0, and net10.0 with no warnings or errorsThis PR now targets
maindirectly because #981 merged the preceding scope-management layer.