Repository navigation
fix(core): release replaced nodes in the validation binding tracker - #966
Merged
Merged
Conversation
ValidationBindingTrackerViewPlugin maps each resolved node to its source node so it can carry binding trees from one update to the next. It cleared every other per-update map at the end of each root update, but never resolvedNodeMap, so the map kept every node any update had resolved, with its resolved subtree, for as long as the view was current. Clear the map with the others. It's only read while the root finishes an update, and every node in that update sets its entry first.
This was referenced Nov 10, 2026
Contributor
Benchmark ResultsComparison against baseline from
|
| Benchmark | Current | Baseline | Change |
|---|---|---|---|
core/player/src/binding/__tests__/parser.bench.ts > parser benchmarks > Resolving binding: foo.bar |
823.03K ops/s | 925.06K ops/s | -11.0% |
core/player/src/binding/__tests__/parser.bench.ts > parser benchmarks > Resolving binding: foo.pets.1.name |
538.69K ops/s | 521.10K ops/s | +3.4% |
core/player/src/binding/__tests__/parser.bench.ts > parser benchmarks > Resolving binding: foo.pets.01.name |
473.06K ops/s | 503.37K ops/s | -6.0% |
core/player/src/binding/__tests__/parser.bench.ts > parser benchmarks > Resolving binding: foo.pets['01'].name |
446.66K ops/s | 501.47K ops/s | -10.9% |
core/player/src/binding/__tests__/parser.bench.ts > parser benchmarks > Resolving binding: foo.pets[01].name |
501.04K ops/s | 492.83K ops/s | +1.7% |
core/player/src/binding/__tests__/parser.bench.ts > parser benchmarks > Resolving binding: foo.pets[name = "frodo"].type |
267.56K ops/s | 279.80K ops/s | -4.4% |
core/player/src/binding/__tests__/parser.bench.ts > parser benchmarks > Resolving binding: foo.pets["name" = "sprinkles"].type |
224.75K ops/s | 235.69K ops/s | -4.6% |
core/player/src/binding/__tests__/parser.bench.ts > parser benchmarks > Resolving binding: foo.pets["isDog" = false].type |
264.37K ops/s | 308.07K ops/s | -14.2% |
core/player/src/binding/__tests__/parser.bench.ts > parser benchmarks > Resolving binding: foo.pets["isDog" = true].type |
244.83K ops/s | 318.65K ops/s | -23.2% |
core/player/src/binding/__tests__/parser.bench.ts > binding creation benchmarks > Resolving binding: foo.bar |
516.46K ops/s | 605.13K ops/s | -14.7% |
core/player/src/binding/__tests__/parser.bench.ts > binding creation benchmarks > Resolving binding: foo.pets.1.name |
294.65K ops/s | 389.77K ops/s | -24.4% |
core/player/src/binding/__tests__/parser.bench.ts > binding creation benchmarks > Resolving binding: foo.pets.01.name |
299.75K ops/s | 392.62K ops/s | -23.7% |
core/player/src/binding/__tests__/parser.bench.ts > binding creation benchmarks > Resolving binding: foo.pets['01'].name |
247.78K ops/s | 358.56K ops/s | -30.9% |
core/player/src/binding/__tests__/parser.bench.ts > binding creation benchmarks > Resolving binding: foo.pets[01].name |
348.99K ops/s | 393.40K ops/s | -11.3% |
core/player/src/binding/__tests__/parser.bench.ts > binding creation benchmarks > Resolving binding: foo.pets[name = "frodo"].type |
226.48K ops/s | 250.49K ops/s | -9.6% |
core/player/src/binding/__tests__/parser.bench.ts > binding creation benchmarks > Resolving binding: foo.pets["name" = "sprinkles"].type |
169.94K ops/s | 200.40K ops/s | -15.2% |
core/player/src/binding/__tests__/parser.bench.ts > binding creation benchmarks > Resolving binding: foo.pets["isDog" = false].type |
205.89K ops/s | 243.54K ops/s | -15.5% |
core/player/src/binding/__tests__/parser.bench.ts > binding creation benchmarks > Resolving binding: foo.pets["isDog" = true].type |
231.05K ops/s | 256.20K ops/s | -9.8% |
core/player/src/expressions/__tests__/performance.bench.ts > Expression Parsing/Execution Benchmark > Parsing: {{foo}} = 1 + 3 (sync) |
441.04K ops/s | 490.09K ops/s | -10.0% |
core/player/src/expressions/__tests__/performance.bench.ts > Expression Parsing/Execution Benchmark > Parsing: {{foo}} = 1 + 3 (async) |
313.50K ops/s | 398.74K ops/s | -21.4% |
core/player/src/expressions/__tests__/performance.bench.ts > Expression Parsing/Execution Benchmark > Parsing: conditional(true, true, false) (sync) |
467.94K ops/s | 501.45K ops/s | -6.7% |
core/player/src/expressions/__tests__/performance.bench.ts > Expression Parsing/Execution Benchmark > Parsing: conditional(true, true, false) (async) |
385.91K ops/s | 441.52K ops/s | -12.6% |
core/player/src/expressions/__tests__/performance.bench.ts > Expression Parsing/Execution Benchmark > Parsing: {{foo}} = conditional({{bar}} > 0, true, false) (sync) |
161.66K ops/s | 221.46K ops/s | -27.0% |
core/player/src/expressions/__tests__/performance.bench.ts > Expression Parsing/Execution Benchmark > Parsing: {{foo}} = conditional({{bar}} > 0, true, false) (async) |
159.73K ops/s | 206.12K ops/s | -22.5% |
core/player/src/expressions/__tests__/performance.bench.ts > Expression Parsing/Execution Benchmark > Parsing: {{foo}} = conditional(conditional(true = false, false, true), conditional(false = false, true, false), conditional(true = true, false, true)) (sync) |
159.90K ops/s | 153.99K ops/s | +3.8% |
core/player/src/expressions/__tests__/performance.bench.ts > Expression Parsing/Execution Benchmark > Parsing: {{foo}} = conditional(conditional(true = false, false, true), conditional(false = false, true, false), conditional(true = true, false, true)) (async) |
149.69K ops/s | 158.90K ops/s | -5.8% |
core/player/src/expressions/__tests__/performance.bench.ts > Expression Parsing/Execution Benchmark > Parsing: {{foo}} = await(asyncTestFunction(1)) (sync) |
N/A | N/A | N/A |
core/player/src/expressions/__tests__/performance.bench.ts > Expression Parsing/Execution Benchmark > Parsing: {{foo}} = await(asyncTestFunction(1)) (async) |
247.18K ops/s | 298.85K ops/s | -17.3% |
core/player/src/expressions/__tests__/performance.bench.ts > Expression Parsing/Execution Benchmark > Parsing: {{foo}} = asyncTestFunction(1) (sync) |
306.34K ops/s | 344.27K ops/s | -11.0% |
core/player/src/expressions/__tests__/performance.bench.ts > Expression Parsing/Execution Benchmark > Parsing: {{foo}} = asyncTestFunction(1) (async) |
260.72K ops/s | 314.43K ops/s | -17.1% |
core/player/src/expressions/__tests__/performance.bench.ts > Expression Parsing/Execution Benchmark > Parsing: asyncTestFunction(1) (sync) |
825.98K ops/s | 942.19K ops/s | -12.3% |
core/player/src/expressions/__tests__/performance.bench.ts > Expression Parsing/Execution Benchmark > Parsing: asyncTestFunction(1) (async) |
435.90K ops/s | 742.09K ops/s | -41.3% |
core/player/src/expressions/__tests__/performance.bench.ts > Expression Parsing/Execution Benchmark > Parsing: {{foo}} = conditional(!{{bar}} == false, await(asyncTestFunction(1)), false) (sync) |
163.96K ops/s | 193.03K ops/s | -15.1% |
core/player/src/expressions/__tests__/performance.bench.ts > Expression Parsing/Execution Benchmark > Parsing: {{foo}} = conditional(!{{bar}} == false, await(asyncTestFunction(1)), false) (async) |
171.97K ops/s | 177.43K ops/s | -3.1% |
core/player/src/view/resolver/__tests__/index.bench.ts > resolver benchmarks > initial resolve |
625.51 ops/s | 695.31 ops/s | -10.0% |
core/player/src/view/resolver/__tests__/index.bench.ts > resolver benchmarks > Resolving from cache |
15.58K ops/s | 21.96K ops/s | -29.0% |
core/player/src/view/resolver/__tests__/index.bench.ts > resolver benchmarks > data changes |
2.83K ops/s | 3.14K ops/s | -10.0% |
core/player/src/view/resolver/__tests__/index.bench.ts > resolver benchmarks > data changes slow |
570.62 ops/s | 660.60 ops/s | -13.6% |
plugins/async-node/core ⚠️
| Benchmark | Current | Baseline | Change |
|---|---|---|---|
plugins/async-node/core/src/__tests__/index.bench.ts > async node benchmarks > Resolve Async Node 1 times |
13.02K ops/s | 13.80K ops/s | -5.6% |
plugins/async-node/core/src/__tests__/index.bench.ts > async node benchmarks > Resolve Async Node 5 times |
12.28K ops/s | 11.81K ops/s | +4.0% |
plugins/async-node/core/src/__tests__/index.bench.ts > async node benchmarks > Resolve Async Node 10 times |
7.89K ops/s | 10.29K ops/s | -23.4% |
plugins/async-node/core/src/__tests__/index.bench.ts > async node benchmarks > Resolve Async Node 50 times |
2.93K ops/s | 3.26K ops/s | -10.3% |
plugins/async-node/core/src/__tests__/index.bench.ts > async node benchmarks > Resolve Async Node 100 times |
1.47K ops/s | 1.29K ops/s | +13.4% ✅ |
plugins/async-node/core/src/__tests__/transform.bench.ts > async transform benchmarks > Resolve Async Node 1 times |
6.49K ops/s | 7.74K ops/s | -16.1% |
plugins/async-node/core/src/__tests__/transform.bench.ts > async transform benchmarks > Resolve Async Node 5 times |
7.08K ops/s | 8.61K ops/s | -17.8% |
plugins/async-node/core/src/__tests__/transform.bench.ts > async transform benchmarks > Resolve Async Node 10 times |
6.21K ops/s | 7.56K ops/s | -17.9% |
plugins/async-node/core/src/__tests__/transform.bench.ts > async transform benchmarks > Resolve Async Node 50 times |
2.41K ops/s | 2.84K ops/s | -15.2% |
plugins/async-node/core/src/__tests__/transform.bench.ts > async transform benchmarks > Resolve Async Node 100 times |
1.39K ops/s | 1.48K ops/s | -6.1% |
react/player ⚠️
| Benchmark | Current | Baseline | Change |
|---|---|---|---|
react/player/src/asset/__tests__/index.bench.tsx > ReactAsset benchmarks > Render asset nested in 1 ReactAssets |
530.02 ops/s | 581.40 ops/s | -8.8% |
react/player/src/asset/__tests__/index.bench.tsx > ReactAsset benchmarks > Bubble errors nested in 1 ReactAssets |
905.05 ops/s | 887.17 ops/s | +2.0% |
react/player/src/asset/__tests__/index.bench.tsx > ReactAsset benchmarks > Render asset nested in 5 ReactAssets |
571.96 ops/s | 601.54 ops/s | -4.9% |
react/player/src/asset/__tests__/index.bench.tsx > ReactAsset benchmarks > Bubble errors nested in 5 ReactAssets |
887.84 ops/s | 996.91 ops/s | -10.9% |
react/player/src/asset/__tests__/index.bench.tsx > ReactAsset benchmarks > Render asset nested in 10 ReactAssets |
505.63 ops/s | 600.54 ops/s | -15.8% |
react/player/src/asset/__tests__/index.bench.tsx > ReactAsset benchmarks > Bubble errors nested in 10 ReactAssets |
828.75 ops/s | 550.59 ops/s | +50.5% ✅ |
react/player/src/asset/__tests__/index.bench.tsx > ReactAsset benchmarks > Render asset nested in 50 ReactAssets |
419.15 ops/s | 425.02 ops/s | -1.4% |
react/player/src/asset/__tests__/index.bench.tsx > ReactAsset benchmarks > Bubble errors nested in 50 ReactAssets |
219.42 ops/s | 192.67 ops/s | +13.9% ✅ |
react/player/src/asset/__tests__/index.bench.tsx > ReactAsset benchmarks > Render asset nested in 100 ReactAssets |
354.24 ops/s | 346.42 ops/s | +2.3% |
react/player/src/asset/__tests__/index.bench.tsx > ReactAsset benchmarks > Bubble errors nested in 100 ReactAssets |
100.36 ops/s | 95.61 ops/s | +5.0% |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #966 +/- ##
===========================
===========================
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Bundle ReportChanges will increase total bundle size by 20.91kB (0.35%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: plugins/markdown/coreAssets Changed:
view changes for bundle: plugins/a2ui/coreAssets Changed:
view changes for bundle: plugins/external-state/coreAssets Changed:
view changes for bundle: core/playerAssets Changed:
view changes for bundle: plugins/async-node/coreAssets Changed:
view changes for bundle: plugins/reference-assets/coreAssets Changed:
view changes for bundle: plugins/check-path/coreAssets Changed:
view changes for bundle: plugins/metrics/coreAssets Changed:
view changes for bundle: plugins/beacon/coreAssets Changed:
|
KetanReddy
approved these changes
Nov 10, 2026
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.
Bottom of a stack: #967 is stacked on this PR, and #968 on that one. This fix doesn't depend on either; the stack only sets the merge order.
ValidationBindingTrackerViewPluginkeeps every node that any update of a view resolves, for as long as the view stays current. A view whose data changes often grows memory with each update, and gets it back only when Player moves to another view.Why it's needed
The tracker maps each resolved node to its source node in
resolvedNodeMap, so it can carry validation bindings from one update to the next. When the root node finishes an update, it clears its other per-update maps, but notresolvedNodeMap. Each entry holds a resolved node and, through its children, that node's whole resolved subtree. So every update adds the nodes it resolved again, and the ones they replaced are never released.Any view that updates repeatedly while it stays on screen is affected: typing into inputs, polling, or data a plugin loads in the background. In a measurement with a view of 200 text assets updated 200 times, the heap grew by 14.24 MB on
mainand by 0.30 MB with this change.Change
Clear
resolvedNodeMapwith the other maps when the root finishes an update. The map is read only at that moment, and every node resolved in an update sets its entry before the root finishes, so nothing reads an entry this clears.Tests
binding-tracker.test.tsupdates a view 20 times, holds the nodes each update resolved inWeakRefs, forces garbage collection, and checks that the nodes later updates replaced were released. Onmain, 19 replaced nodes are still held after garbage collection; with the change, none are. The test turns ongcwithv8.setFlagsFromString("--expose-gc"), because vitest doesn't pass Node flags through to tests.Change Type (required)
Indicate the type of change your pull request is:
patchminormajorN/ADoes your PR have any documentation updates?