Repository navigation
Add IntersectionObserver performance benchmarks (#60309) - #60309
Open
rubennorte wants to merge 1 commit into
Open
rubennorte wants to merge 1 commit into
rubennorte wants to merge 1 commit into
Conversation
|
@rubennorte has exported this pull request. If you are a Meta employee, you can view the originating Diff in D134252378. |
javache
approved these changes
Nov 26, 2026
javache
left a comment
Contributor
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
Summary: ## Context Benchmarks should cover how IntersectionObserver is normally configured: one or two thresholds, with ten and one hundred as bounds. ## Changes Keep all public benchmark additions in this first, benchmark-only diff. Cover 1, 2, 10, and 100 thresholds, deep implicit/explicit roots, and target/root ratio reads. Parameterize callback-count assertions for the threshold count. No runtime implementation or API threshold-count limit is changed. ## Baseline benchmark results Optimized Fantom (native + Hermes bytecode), headless Linux, fixed CPU affinity. This benchmark-only baseline includes landed scrollMargin support, but no runtime changes from this stack. Values are median CPU time per complete invocation from the current run; setup/assertions are outside timed work. Scaling cases have 100 measured invocations and cover 1/2 thresholds plus 10/100 bounds. | Benchmark | Baseline CPU | | --- | --- | | `Read intersectionRatio 1000 times` | 5.105 ms | | `Read rnRootIntersectionRatio 1000 times` | 4.962 ms | | `Scroll 100 targets, depth 1, 1 thresholds, implicit root` | 7.238 ms | | `Scroll 100 targets, depth 1, 2 thresholds, implicit root` | 7.513 ms | | `Scroll 100 targets, depth 1, 10 thresholds, implicit root` | 8.560 ms | | `Scroll 100 targets, depth 1, 100 thresholds, implicit root` | 20.442 ms | | `Scroll 100 targets, depth 40, 1 thresholds, implicit root` | 38.032 ms | | `Scroll 100 targets, depth 40, 1 thresholds, explicit root` | 46.293 ms | Scrolling includes mounting and intersection computation, plus callbacks when thresholds are crossed. Ratio rows measure consumer reads, not notification dispatch. Changelog: [Internal] Reviewed By: javache Differential Revision: D134252378
rubennorte
force-pushed
the
export-D134252378
branch
from
November 26, 2026 14:16
7d4414a to
c31ebbd
Compare
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Nov 26, 2026
Summary: ## Context Benchmarks should cover how IntersectionObserver is normally configured: one or two thresholds, with ten and one hundred as bounds. ## Changes Keep all public benchmark additions in this first, benchmark-only diff. Cover 1, 2, 10, and 100 thresholds, deep implicit/explicit roots, and target/root ratio reads. Parameterize callback-count assertions for the threshold count. No runtime implementation or API threshold-count limit is changed. ## Baseline benchmark results Optimized Fantom (native + Hermes bytecode), headless Linux, fixed CPU affinity. This benchmark-only baseline includes landed scrollMargin support, but no runtime changes from this stack. Values are median CPU time per complete invocation from the current run; setup/assertions are outside timed work. Scaling cases have 100 measured invocations and cover 1/2 thresholds plus 10/100 bounds. | Benchmark | Baseline CPU | | --- | --- | | `Read intersectionRatio 1000 times` | 5.105 ms | | `Read rnRootIntersectionRatio 1000 times` | 4.962 ms | | `Scroll 100 targets, depth 1, 1 thresholds, implicit root` | 7.238 ms | | `Scroll 100 targets, depth 1, 2 thresholds, implicit root` | 7.513 ms | | `Scroll 100 targets, depth 1, 10 thresholds, implicit root` | 8.560 ms | | `Scroll 100 targets, depth 1, 100 thresholds, implicit root` | 20.442 ms | | `Scroll 100 targets, depth 40, 1 thresholds, implicit root` | 38.032 ms | | `Scroll 100 targets, depth 40, 1 thresholds, explicit root` | 46.293 ms | Scrolling includes mounting and intersection computation, plus callbacks when thresholds are crossed. Ratio rows measure consumer reads, not notification dispatch. Changelog: [Internal] Reviewed By: javache Differential Revision: D134252378
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Nov 26, 2026
Summary: ## Context Benchmarks should cover how IntersectionObserver is normally configured: one or two thresholds, with ten and one hundred as bounds. ## Changes Keep all public benchmark additions in this first, benchmark-only diff. Cover 1, 2, 10, and 100 thresholds, deep implicit/explicit roots, and target/root ratio reads. Parameterize callback-count assertions for the threshold count. No runtime implementation or API threshold-count limit is changed. ## Baseline benchmark results Optimized Fantom (native + Hermes bytecode), headless Linux, fixed CPU affinity. This benchmark-only baseline includes landed scrollMargin support, but no runtime changes from this stack. Values are median CPU time per complete invocation from the current run; setup/assertions are outside timed work. Scaling cases have 100 measured invocations and cover 1/2 thresholds plus 10/100 bounds. | Benchmark | Baseline CPU | | --- | --- | | `Read intersectionRatio 1000 times` | 5.105 ms | | `Read rnRootIntersectionRatio 1000 times` | 4.962 ms | | `Scroll 100 targets, depth 1, 1 thresholds, implicit root` | 7.238 ms | | `Scroll 100 targets, depth 1, 2 thresholds, implicit root` | 7.513 ms | | `Scroll 100 targets, depth 1, 10 thresholds, implicit root` | 8.560 ms | | `Scroll 100 targets, depth 1, 100 thresholds, implicit root` | 20.442 ms | | `Scroll 100 targets, depth 40, 1 thresholds, implicit root` | 38.032 ms | | `Scroll 100 targets, depth 40, 1 thresholds, explicit root` | 46.293 ms | Scrolling includes mounting and intersection computation, plus callbacks when thresholds are crossed. Ratio rows measure consumer reads, not notification dispatch. Changelog: [Internal] Reviewed By: javache Differential Revision: D134252378
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Nov 26, 2026
Summary: ## Context Benchmarks should cover how IntersectionObserver is normally configured: one or two thresholds, with ten and one hundred as bounds. ## Changes Keep all public benchmark additions in this first, benchmark-only diff. Cover 1, 2, 10, and 100 thresholds, deep implicit/explicit roots, and target/root ratio reads. Parameterize callback-count assertions for the threshold count. No runtime implementation or API threshold-count limit is changed. ## Baseline benchmark results Optimized Fantom (native + Hermes bytecode), headless Linux, fixed CPU affinity. This benchmark-only baseline includes landed scrollMargin support, but no runtime changes from this stack. Values are median CPU time per complete invocation from the current run; setup/assertions are outside timed work. Scaling cases have 100 measured invocations and cover 1/2 thresholds plus 10/100 bounds. | Benchmark | Baseline CPU | | --- | --- | | `Read intersectionRatio 1000 times` | 5.105 ms | | `Read rnRootIntersectionRatio 1000 times` | 4.962 ms | | `Scroll 100 targets, depth 1, 1 thresholds, implicit root` | 7.238 ms | | `Scroll 100 targets, depth 1, 2 thresholds, implicit root` | 7.513 ms | | `Scroll 100 targets, depth 1, 10 thresholds, implicit root` | 8.560 ms | | `Scroll 100 targets, depth 1, 100 thresholds, implicit root` | 20.442 ms | | `Scroll 100 targets, depth 40, 1 thresholds, implicit root` | 38.032 ms | | `Scroll 100 targets, depth 40, 1 thresholds, explicit root` | 46.293 ms | Scrolling includes mounting and intersection computation, plus callbacks when thresholds are crossed. Ratio rows measure consumer reads, not notification dispatch. Changelog: [Internal] Reviewed By: javache Differential Revision: D134252378
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Nov 26, 2026
Summary: ## Context Benchmarks should cover how IntersectionObserver is normally configured: one or two thresholds, with ten and one hundred as bounds. ## Changes Keep all public benchmark additions in this first, benchmark-only diff. Cover 1, 2, 10, and 100 thresholds, deep implicit/explicit roots, and target/root ratio reads. Parameterize callback-count assertions for the threshold count. No runtime implementation or API threshold-count limit is changed. ## Baseline benchmark results Optimized Fantom (native + Hermes bytecode), headless Linux, fixed CPU affinity. This benchmark-only baseline includes landed scrollMargin support, but no runtime changes from this stack. Values are median CPU time per complete invocation from the current run; setup/assertions are outside timed work. Scaling cases have 100 measured invocations and cover 1/2 thresholds plus 10/100 bounds. | Benchmark | Baseline CPU | | --- | --- | | `Read intersectionRatio 1000 times` | 5.105 ms | | `Read rnRootIntersectionRatio 1000 times` | 4.962 ms | | `Scroll 100 targets, depth 1, 1 thresholds, implicit root` | 7.238 ms | | `Scroll 100 targets, depth 1, 2 thresholds, implicit root` | 7.513 ms | | `Scroll 100 targets, depth 1, 10 thresholds, implicit root` | 8.560 ms | | `Scroll 100 targets, depth 1, 100 thresholds, implicit root` | 20.442 ms | | `Scroll 100 targets, depth 40, 1 thresholds, implicit root` | 38.032 ms | | `Scroll 100 targets, depth 40, 1 thresholds, explicit root` | 46.293 ms | Scrolling includes mounting and intersection computation, plus callbacks when thresholds are crossed. Ratio rows measure consumer reads, not notification dispatch. Changelog: [Internal] Reviewed By: javache Differential Revision: D134252378
This branch has not been deployed
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:
Context
Benchmarks should cover how IntersectionObserver is normally configured: one or two thresholds, with ten and one hundred as bounds.
Changes
Keep all public benchmark additions in this first, benchmark-only diff. Cover 1, 2, 10, and 100 thresholds, deep implicit/explicit roots, and target/root ratio reads. Parameterize callback-count assertions for the threshold count. No runtime implementation or API threshold-count limit is changed.
Baseline benchmark results
Optimized Fantom (native + Hermes bytecode), headless Linux, fixed CPU affinity. This benchmark-only baseline includes landed scrollMargin support, but no runtime changes from this stack. Values are median CPU time per complete invocation from the current run; setup/assertions are outside timed work. Scaling cases have 100 measured invocations and cover 1/2 thresholds plus 10/100 bounds.
Read intersectionRatio 1000 timesRead rnRootIntersectionRatio 1000 timesScroll 100 targets, depth 1, 1 thresholds, implicit rootScroll 100 targets, depth 1, 2 thresholds, implicit rootScroll 100 targets, depth 1, 10 thresholds, implicit rootScroll 100 targets, depth 1, 100 thresholds, implicit rootScroll 100 targets, depth 40, 1 thresholds, implicit rootScroll 100 targets, depth 40, 1 thresholds, explicit rootScrolling includes mounting and intersection computation, plus callbacks when thresholds are crossed. Ratio rows measure consumer reads, not notification dispatch.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D134252378