Skip to content

Add MutationObserver commit benchmarks (#60267) - #60267

Merged
meta-codesync[bot] merged 1 commit into
react:mainfrom
rubennorte:export-D134249229
Nov 26, 2026
Merged

meta-codesync[bot] merged 1 commit into
react:mainfrom
rubennorte:export-D134249229

Conversation

@rubennorte

@rubennorte rubennorte commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Summary:

Context

MutationObserver observation adds work to React commits even when a commit does not change the observed child list. Establish public-API benchmarks before changing the native implementation so that each optimization can be measured independently against the same workloads.

Changes

Add 47 Fantom scenarios covering widths 2, 32, 256 and 1,024; parent props, append, full replacement, reorder and descendant changes; shallow/deep observation; unobserved controls; and multiple observers. Setup, reset renders, assertions and cleanup are outside the measured interval. Each measured update includes reconciliation, observation, layout/mount processing, record conversion and callback delivery.

Baseline results

Optimized native/JS code and Hermes bytecode, with MutationObserver enabled. These are fresh measurements after rebasing: milliseconds of end-to-end update CPU time, aggregated as the median of three process runs' p50 values. Setup, reset renders, assertions and cleanup are outside the measured interval; reconciliation, observation, layout/mount work, record conversion and callback delivery are included.

Workload Children Observers Baseline CPU time (ms)
Parent props only, deep observation 1,024 1 3.846
Append one child 1,024 1 6.322
Add a grandchild in the last retained child 1,024 1 6.271
Reverse retained children 1,024 1 8.716
Replace all children 1,024 1 30.210
Parent props only, deep observation 256 10 1.843

All 47 scenarios passed in each of three timing runs per variant. Each scenario used at least 100 measured iterations, at least 250 ms measured execution, and 10 warmup iterations. These are synthetic measurements from one Linux worker, not isolated observer timings or device/app latency guarantees. Individual runs and unobserved controls varied; percentages are observed ratios of aggregate medians, not causal estimates or guaranteed speedups.

The following optimizations use this benchmark unchanged.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D134249229

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 24, 2026
@meta-codesync

meta-codesync Bot commented Nov 24, 2026

Copy link
Copy Markdown

@rubennorte has exported this pull request. If you are a Meta employee, you can view the originating Diff in D134249229.

rubennorte added a commit to rubennorte/react-native that referenced this pull request Nov 26, 2026
Summary:

## Context

MutationObserver observation adds work to React commits even when a commit does not change the observed child list. Establish public-API benchmarks before changing the native implementation so that each optimization can be measured independently against the same workloads.

## Changes

Add 47 Fantom scenarios covering widths 2, 32, 256 and 1,024; parent props, append, full replacement, reorder and descendant changes; shallow/deep observation; unobserved controls; and multiple observers. Setup, reset renders, assertions and cleanup are outside the measured interval. Each measured update includes reconciliation, observation, layout/mount processing, record conversion and callback delivery.

## Baseline results

Optimized native/JS code and Hermes bytecode, with MutationObserver enabled. These are fresh measurements after rebasing: milliseconds of end-to-end update CPU time, aggregated as the median of three process runs' p50 values. Setup, reset renders, assertions and cleanup are outside the measured interval; reconciliation, observation, layout/mount work, record conversion and callback delivery are included.

| Workload | Children | Observers | Baseline CPU time (ms) |
| --- | ---: | ---: | ---: |
| Parent props only, deep observation | 1,024 | 1 | 3.846 |
| Append one child | 1,024 | 1 | 6.322 |
| Add a grandchild in the last retained child | 1,024 | 1 | 6.271 |
| Reverse retained children | 1,024 | 1 | 8.716 |
| Replace all children | 1,024 | 1 | 30.210 |
| Parent props only, deep observation | 256 | 10 | 1.843 |

All 47 scenarios passed in each of three timing runs per variant. Each scenario used at least 100 measured iterations, at least 250 ms measured execution, and 10 warmup iterations. These are synthetic measurements from one Linux worker, not isolated observer timings or device/app latency guarantees. Individual runs and unobserved controls varied; percentages are observed ratios of aggregate medians, not causal estimates or guaranteed speedups.

The following optimizations use this benchmark unchanged.

Changelog: [Internal]

Differential Revision: D134249229
@meta-codesync meta-codesync Bot changed the title Add MutationObserver commit benchmarks Add MutationObserver commit benchmarks (#60267) Nov 26, 2026
rubennorte added a commit to rubennorte/react-native that referenced this pull request Nov 26, 2026
Summary:

## Context

MutationObserver observation adds work to React commits even when a commit does not change the observed child list. Establish public-API benchmarks before changing the native implementation so that each optimization can be measured independently against the same workloads.

## Changes

Add 47 Fantom scenarios covering widths 2, 32, 256 and 1,024; parent props, append, full replacement, reorder and descendant changes; shallow/deep observation; unobserved controls; and multiple observers. Setup, reset renders, assertions and cleanup are outside the measured interval. Each measured update includes reconciliation, observation, layout/mount processing, record conversion and callback delivery.

## Baseline results

Optimized native/JS code and Hermes bytecode, with MutationObserver enabled. These are fresh measurements after rebasing: milliseconds of end-to-end update CPU time, aggregated as the median of three process runs' p50 values. Setup, reset renders, assertions and cleanup are outside the measured interval; reconciliation, observation, layout/mount work, record conversion and callback delivery are included.

| Workload | Children | Observers | Baseline CPU time (ms) |
| --- | ---: | ---: | ---: |
| Parent props only, deep observation | 1,024 | 1 | 3.846 |
| Append one child | 1,024 | 1 | 6.322 |
| Add a grandchild in the last retained child | 1,024 | 1 | 6.271 |
| Reverse retained children | 1,024 | 1 | 8.716 |
| Replace all children | 1,024 | 1 | 30.210 |
| Parent props only, deep observation | 256 | 10 | 1.843 |

All 47 scenarios passed in each of three timing runs per variant. Each scenario used at least 100 measured iterations, at least 250 ms measured execution, and 10 warmup iterations. These are synthetic measurements from one Linux worker, not isolated observer timings or device/app latency guarantees. Individual runs and unobserved controls varied; percentages are observed ratios of aggregate medians, not causal estimates or guaranteed speedups.

The following optimizations use this benchmark unchanged.

Changelog: [Internal]

Differential Revision: D134249229

@javache javache left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

rubennorte added a commit to rubennorte/react-native that referenced this pull request Nov 26, 2026
Summary:

## Context

MutationObserver observation adds work to React commits even when a commit does not change the observed child list. Establish public-API benchmarks before changing the native implementation so that each optimization can be measured independently against the same workloads.

## Changes

Add 47 Fantom scenarios covering widths 2, 32, 256 and 1,024; parent props, append, full replacement, reorder and descendant changes; shallow/deep observation; unobserved controls; and multiple observers. Setup, reset renders, assertions and cleanup are outside the measured interval. Each measured update includes reconciliation, observation, layout/mount processing, record conversion and callback delivery.

## Baseline results

Optimized native/JS code and Hermes bytecode, with MutationObserver enabled. These are fresh measurements after rebasing: milliseconds of end-to-end update CPU time, aggregated as the median of three process runs' p50 values. Setup, reset renders, assertions and cleanup are outside the measured interval; reconciliation, observation, layout/mount work, record conversion and callback delivery are included.

| Workload | Children | Observers | Baseline CPU time (ms) |
| --- | ---: | ---: | ---: |
| Parent props only, deep observation | 1,024 | 1 | 3.846 |
| Append one child | 1,024 | 1 | 6.322 |
| Add a grandchild in the last retained child | 1,024 | 1 | 6.271 |
| Reverse retained children | 1,024 | 1 | 8.716 |
| Replace all children | 1,024 | 1 | 30.210 |
| Parent props only, deep observation | 256 | 10 | 1.843 |

All 47 scenarios passed in each of three timing runs per variant. Each scenario used at least 100 measured iterations, at least 250 ms measured execution, and 10 warmup iterations. These are synthetic measurements from one Linux worker, not isolated observer timings or device/app latency guarantees. Individual runs and unobserved controls varied; percentages are observed ratios of aggregate medians, not causal estimates or guaranteed speedups.

The following optimizations use this benchmark unchanged.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D134249229
Summary:

## Context

MutationObserver observation adds work to React commits even when a commit does not change the observed child list. Establish public-API benchmarks before changing the native implementation so that each optimization can be measured independently against the same workloads.

## Changes

Add 47 Fantom scenarios covering widths 2, 32, 256 and 1,024; parent props, append, full replacement, reorder and descendant changes; shallow/deep observation; unobserved controls; and multiple observers. Setup, reset renders, assertions and cleanup are outside the measured interval. Each measured update includes reconciliation, observation, layout/mount processing, record conversion and callback delivery.

## Baseline results

Optimized native/JS code and Hermes bytecode, with MutationObserver enabled. These are fresh measurements after rebasing: milliseconds of end-to-end update CPU time, aggregated as the median of three process runs' p50 values. Setup, reset renders, assertions and cleanup are outside the measured interval; reconciliation, observation, layout/mount work, record conversion and callback delivery are included.

| Workload | Children | Observers | Baseline CPU time (ms) |
| --- | ---: | ---: | ---: |
| Parent props only, deep observation | 1,024 | 1 | 3.846 |
| Append one child | 1,024 | 1 | 6.322 |
| Add a grandchild in the last retained child | 1,024 | 1 | 6.271 |
| Reverse retained children | 1,024 | 1 | 8.716 |
| Replace all children | 1,024 | 1 | 30.210 |
| Parent props only, deep observation | 256 | 10 | 1.843 |

All 47 scenarios passed in each of three timing runs per variant. Each scenario used at least 100 measured iterations, at least 250 ms measured execution, and 10 warmup iterations. These are synthetic measurements from one Linux worker, not isolated observer timings or device/app latency guarantees. Individual runs and unobserved controls varied; percentages are observed ratios of aggregate medians, not causal estimates or guaranteed speedups.

The following optimizations use this benchmark unchanged.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D134249229
rubennorte added a commit to rubennorte/react-native that referenced this pull request Nov 26, 2026
Summary:

## Context

MutationObserver observation adds work to React commits even when a commit does not change the observed child list. Establish public-API benchmarks before changing the native implementation so that each optimization can be measured independently against the same workloads.

## Changes

Add 47 Fantom scenarios covering widths 2, 32, 256 and 1,024; parent props, append, full replacement, reorder and descendant changes; shallow/deep observation; unobserved controls; and multiple observers. Setup, reset renders, assertions and cleanup are outside the measured interval. Each measured update includes reconciliation, observation, layout/mount processing, record conversion and callback delivery.

## Baseline results

Optimized native/JS code and Hermes bytecode, with MutationObserver enabled. These comparative measurements were collected at the preceding stable snapshot with the same observer implementations and benchmark fixtures: milliseconds of end-to-end update CPU time, aggregated as the median of three process runs' p50 values. Setup, reset renders, assertions and cleanup are outside the measured interval; reconciliation, observation, layout/mount work, record conversion and callback delivery are included.

| Workload | Children | Observers | Baseline CPU time (ms) |
| --- | ---: | ---: | ---: |
| Parent props only, deep observation | 1,024 | 1 | 3.846 |
| Append one child | 1,024 | 1 | 6.322 |
| Add a grandchild in the last retained child | 1,024 | 1 | 6.271 |
| Reverse retained children | 1,024 | 1 | 8.716 |
| Replace all children | 1,024 | 1 | 30.210 |
| Parent props only, deep observation | 256 | 10 | 1.843 |

All 47 scenarios passed in each of three timing runs per variant. Each scenario used at least 100 measured iterations, at least 250 ms measured execution, and 10 warmup iterations. These are synthetic measurements from one Linux worker, not isolated observer timings or device/app latency guarantees. Individual runs and unobserved controls varied; percentages are observed ratios of aggregate medians, not causal estimates or guaranteed speedups.

The following optimizations use this benchmark unchanged.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D134249229
@rubennorte
rubennorte force-pushed the export-D134249229 branch 2 times, most recently from 323b854 to cb54bcf Compare November 26, 2026 14:22
rubennorte added a commit to rubennorte/react-native that referenced this pull request Nov 26, 2026
Summary:

## Context

MutationObserver observation adds work to React commits even when a commit does not change the observed child list. Establish public-API benchmarks before changing the native implementation so that each optimization can be measured independently against the same workloads.

## Changes

Add 47 Fantom scenarios covering widths 2, 32, 256 and 1,024; parent props, append, full replacement, reorder and descendant changes; shallow/deep observation; unobserved controls; and multiple observers. Setup, reset renders, assertions and cleanup are outside the measured interval. Each measured update includes reconciliation, observation, layout/mount processing, record conversion and callback delivery.

## Baseline results

Optimized native/JS code and Hermes bytecode, with MutationObserver enabled. These comparative measurements were collected at the preceding stable snapshot with the same observer implementations and benchmark fixtures: milliseconds of end-to-end update CPU time, aggregated as the median of three process runs' p50 values. Setup, reset renders, assertions and cleanup are outside the measured interval; reconciliation, observation, layout/mount work, record conversion and callback delivery are included.

| Workload | Children | Observers | Baseline CPU time (ms) |
| --- | ---: | ---: | ---: |
| Parent props only, deep observation | 1,024 | 1 | 3.846 |
| Append one child | 1,024 | 1 | 6.322 |
| Add a grandchild in the last retained child | 1,024 | 1 | 6.271 |
| Reverse retained children | 1,024 | 1 | 8.716 |
| Replace all children | 1,024 | 1 | 30.210 |
| Parent props only, deep observation | 256 | 10 | 1.843 |

All 47 scenarios passed in each of three timing runs per variant. Each scenario used at least 100 measured iterations, at least 250 ms measured execution, and 10 warmup iterations. These are synthetic measurements from one Linux worker, not isolated observer timings or device/app latency guarantees. Individual runs and unobserved controls varied; percentages are observed ratios of aggregate medians, not causal estimates or guaranteed speedups.

The following optimizations use this benchmark unchanged.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D134249229
rubennorte added a commit to rubennorte/react-native that referenced this pull request Nov 26, 2026
Summary:

## Context

MutationObserver observation adds work to React commits even when a commit does not change the observed child list. Establish public-API benchmarks before changing the native implementation so that each optimization can be measured independently against the same workloads.

## Changes

Add 47 Fantom scenarios covering widths 2, 32, 256 and 1,024; parent props, append, full replacement, reorder and descendant changes; shallow/deep observation; unobserved controls; and multiple observers. Setup, reset renders, assertions and cleanup are outside the measured interval. Each measured update includes reconciliation, observation, layout/mount processing, record conversion and callback delivery.

## Baseline results

Optimized native/JS code and Hermes bytecode, with MutationObserver enabled. These comparative measurements were collected at the preceding stable snapshot with the same observer implementations and benchmark fixtures: milliseconds of end-to-end update CPU time, aggregated as the median of three process runs' p50 values. Setup, reset renders, assertions and cleanup are outside the measured interval; reconciliation, observation, layout/mount work, record conversion and callback delivery are included.

| Workload | Children | Observers | Baseline CPU time (ms) |
| --- | ---: | ---: | ---: |
| Parent props only, deep observation | 1,024 | 1 | 3.846 |
| Append one child | 1,024 | 1 | 6.322 |
| Add a grandchild in the last retained child | 1,024 | 1 | 6.271 |
| Reverse retained children | 1,024 | 1 | 8.716 |
| Replace all children | 1,024 | 1 | 30.210 |
| Parent props only, deep observation | 256 | 10 | 1.843 |

All 47 scenarios passed in each of three timing runs per variant. Each scenario used at least 100 measured iterations, at least 250 ms measured execution, and 10 warmup iterations. These are synthetic measurements from one Linux worker, not isolated observer timings or device/app latency guarantees. Individual runs and unobserved controls varied; percentages are observed ratios of aggregate medians, not causal estimates or guaranteed speedups.

The following optimizations use this benchmark unchanged.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D134249229
@github-actions github-actions Bot added the Meta Review Required This PR is considered risky and requires Meta to import it to do more testing before merging. label Nov 26, 2026
rubennorte added a commit to rubennorte/react-native that referenced this pull request Nov 26, 2026
Summary:
Pull Request resolved: react#60267

## Context

MutationObserver observation adds work to React commits even when a commit does not change the observed child list. Establish public-API benchmarks before changing the native implementation so that each optimization can be measured independently against the same workloads.

## Changes

Add 47 Fantom scenarios covering widths 2, 32, 256 and 1,024; parent props, append, full replacement, reorder and descendant changes; shallow/deep observation; unobserved controls; and multiple observers. Setup, reset renders, assertions and cleanup are outside the measured interval. Each measured update includes reconciliation, observation, layout/mount processing, record conversion and callback delivery.

## Baseline results

Optimized native/JS code and Hermes bytecode, with MutationObserver enabled. These comparative measurements were collected at the preceding stable snapshot with the same observer implementations and benchmark fixtures: milliseconds of end-to-end update CPU time, aggregated as the median of three process runs' p50 values. Setup, reset renders, assertions and cleanup are outside the measured interval; reconciliation, observation, layout/mount work, record conversion and callback delivery are included.

| Workload | Children | Observers | Baseline CPU time (ms) |
| --- | ---: | ---: | ---: |
| Parent props only, deep observation | 1,024 | 1 | 3.846 |
| Append one child | 1,024 | 1 | 6.322 |
| Add a grandchild in the last retained child | 1,024 | 1 | 6.271 |
| Reverse retained children | 1,024 | 1 | 8.716 |
| Replace all children | 1,024 | 1 | 30.210 |
| Parent props only, deep observation | 256 | 10 | 1.843 |

All 47 scenarios passed in each of three timing runs per variant. Each scenario used at least 100 measured iterations, at least 250 ms measured execution, and 10 warmup iterations. These are synthetic measurements from one Linux worker, not isolated observer timings or device/app latency guarantees. Individual runs and unobserved controls varied; percentages are observed ratios of aggregate medians, not causal estimates or guaranteed speedups.

The following optimizations use this benchmark unchanged.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D134249229
@meta-codesync
meta-codesync Bot merged commit 6db5324 into react:main Nov 26, 2026
87 checks passed
@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @rubennorte in 6db5324

When will my fix make it into a release? | How to file a pick request?

@react-native-bot react-native-bot added the Merged This PR has been merged. label Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Meta Review Required This PR is considered risky and requires Meta to import it to do more testing before merging. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants