René's URL Explorer Experiment


Title: perf(ios): request layout once per turn and append subviews without copying by triniwiz · Pull Request #11507 · NativeScript/NativeScript · GitHub

Open Graph Title: perf(ios): request layout once per turn and append subviews without copying by triniwiz · Pull Request #11507 · NativeScript/NativeScript

X Title: perf(ios): request layout once per turn and append subviews without copying by triniwiz · Pull Request #11507 · NativeScript/NativeScript

Description: PR Checklist The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages. There is an issue for the bug/feature this PR is for. To avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it. You have signed the CLA. All existing tests are passing: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/DevelopmentWorkflow.md#running-unit-tests-application. Tests for the changes are included - https://github.com/NativeScript/NativeScript/blob/master/tools/notes/WritingUnitTests.md. What is the current behavior? requestLayout on iOS climbs to the root on every call and calls setNeedsLayout at each level. CSS calls it once per layout-affecting property, so styling one view costs depth times properties native calls, all reaching ancestors that were already flagged by the first call. insertNativeSubview reads subviews before checking whether an index was given. Reading it copies the array, so appending k children to one parent is O(k^2). What is the new behavior? requestLayout returns early when the view already climbed in this turn and is still flagged. A layout pass in between clears the flag, so the next request climbs again. The set of views is cleared by a microtask at the end of the turn. Appends call addSubview without reading subviews. New specs: a repeat request in the same turn does not climb (fails on main), and a request climbs again in the next turn and after a layout pass. Numbers Scenario (M) Painted before Painted after Attach before Attach after flex-wrap-tiles 1155.9 987.8 551.0 390.6 grid-dashboard 292.7 256.1 143.5 112.0 insert-remove 1144.0 1004.8 541.9 396.0 nested-chain 31.7 27.0 16.1 10.3 relayout-resize 330.2 302.1 118.7 92.3 relayout-style 328.1 302.7 117.5 91.4 styled-cards 385.6 337.1 198.0 152.5 text-flow 205.6 192.8 48.5 40.8 tree-fanout 330.5 299.7 118.6 90.9 Mutation (M) Before After restyle (relayout-style) 185.9 176.2 restore (relayout-style) 186.0 173.6 insert (insert-remove) 466.0 458.4 remove (insert-remove) 303.3 306.0 shrink (relayout-resize) 144.4 143.1 grow (relayout-resize) 144.0 142.9 How this was measured xplat-benchmarks ns-core app (plain core, no plugins), iPhone 17 Pro Max simulator, iOS 26.4. Each scenario mounts about 1,000 views at size M. Base and change were installed alternately for 3 rounds of 10 measured iterations, median ms, lower is better. "Attach" is assigning the built tree to a loaded parent (native view creation, CSS, native setters); "painted" ends one frame after layout. A GC is forced before each mutation, as it already is after each unmount, so a collection pause lands in the same phase for both builds. Part of a series: #11505, #11506, #11507 (this), #11510.

Open Graph Description: PR Checklist The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages. There is an issue for the bug/feature this...

X Description: PR Checklist The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages. There is an issue for the bug/feature this...

Opengraph URL: https://github.com/NativeScript/NativeScript/pull/11507

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:8da61a43-a639-db7a-27ad-ae28a1a3db49
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8B38:24ACB9:18170E5:1FA19EC:6B01335F
html-safe-nonce85d9c70668dccb68dc99d404424845356470d7ec0b72d09f2b60f2524312e09d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QjM4OjI0QUNCOToxODE3MEU1OjFGQTE5RUM6NkIwMTMzNUYiLCJ2aXNpdG9yX2lkIjoiMjQ4ODY0MzIyNzIxNzkwMDM4MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac43eed9313121bb13944a10b00aa3244eb8ea988a12d03f89ca27eeb2f0cb0c7d
hovercard-subject-tagpull_request:4752619722
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/NativeScript/NativeScript/pull/11507/files
twitter:imagehttps://avatars.githubusercontent.com/u/6695919?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/6695919?s=400&v=4
og:image:altPR Checklist The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages. There is an issue for the bug/feature this...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/NativeScript/NativeScript git https://github.com/NativeScript/NativeScript.git
octolytics-dimension-user_id7392261
octolytics-dimension-user_loginNativeScript
octolytics-dimension-repository_id31492490
octolytics-dimension-repository_nwoNativeScript/NativeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id31492490
octolytics-dimension-repository_network_root_nwoNativeScript/NativeScript
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/NativeScript/NativeScript/pull/11507/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2FNativeScript%2Fpull%2F11507%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2FNativeScript%2Fpull%2F11507%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=NativeScript%2FNativeScript
Reloadhttps://github.com/NativeScript/NativeScript/pull/11507/files
Reloadhttps://github.com/NativeScript/NativeScript/pull/11507/files
Reloadhttps://github.com/NativeScript/NativeScript/pull/11507/files
NativeScripthttps://github.com/NativeScript
NativeScripthttps://github.com/NativeScript/NativeScript
Codehttps://github.com/NativeScript/NativeScript
Issues231 (231)https://github.com/NativeScript/NativeScript/issues
Pull requests107 (107)https://github.com/NativeScript/NativeScript/pulls
Discussionshttps://github.com/NativeScript/NativeScript/discussions
Actionshttps://github.com/NativeScript/NativeScript/actions
Projectshttps://github.com/NativeScript/NativeScript/projects
Wikihttps://github.com/NativeScript/NativeScript/wiki
Security and qualityhttps://github.com/NativeScript/NativeScript/security
Insightshttps://github.com/NativeScript/NativeScript/insights
Sign up for GitHub https://github.com/signup?return_to=%2FNativeScript%2FNativeScript%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FNativeScript%2FNativeScript%2Fissues%2Fnew%2Fchoose
NathanWalkerhttps://github.com/NathanWalker
mainhttps://github.com/NativeScript/NativeScript/tree/main
perf/ios-view-attachhttps://github.com/NativeScript/NativeScript/tree/perf/ios-view-attach
Conversation 4 https://github.com/NativeScript/NativeScript/pull/11507
Commits 2 https://github.com/NativeScript/NativeScript/pull/11507/commits
Checks 8 https://github.com/NativeScript/NativeScript/pull/11507/checks
Files changed https://github.com/NativeScript/NativeScript/pull/11507/files
Please reload this pagehttps://github.com/NativeScript/NativeScript/pull/11507/files
perf(ios): request layout once per turn and append subviews without copying https://github.com/NativeScript/NativeScript/pull/11507/files#top
Show all changes 2 commits https://github.com/NativeScript/NativeScript/pull/11507/files
4fd7ff1 perf(ios): request layout once per turn and append subviews without c… triniwiz Oct 6, 2026 https://github.com/NativeScript/NativeScript/pull/11507/commits/4fd7ff131c435a4afac9c2929dcf05352178ad88
3d0b554 fix(ios): climb again when a same-turn layout pass cleared an ancestor NathanWalker Oct 6, 2026 https://github.com/NativeScript/NativeScript/pull/11507/commits/3d0b55480632032e2128407a8f8809f4f17263e0
Clear filters https://github.com/NativeScript/NativeScript/pull/11507/files
Please reload this pagehttps://github.com/NativeScript/NativeScript/pull/11507/files
Please reload this pagehttps://github.com/NativeScript/NativeScript/pull/11507/files
index.ios.ts https://github.com/NativeScript/NativeScript/pull/11507/files#diff-025d8125f2c2388468769424324a18b7a896921f7b44f720db8014eb653b5f84
request-layout.spec.ts https://github.com/NativeScript/NativeScript/pull/11507/files#diff-e43e80f14b35fb8d1d2a73418b79b5836060b18d1f458cd5493a971d80647ab5
index.ios.ts https://github.com/NativeScript/NativeScript/pull/11507/files#diff-83c9fab79b1de3837e713014b8b8a21b7c428d1efbd5b0e36f3aba51cf3b4db4
packages/core/ui/core/view/index.ios.tshttps://github.com/NativeScript/NativeScript/pull/11507/files#diff-025d8125f2c2388468769424324a18b7a896921f7b44f720db8014eb653b5f84
View file https://github.com/NativeScript/NativeScript/blob/3d0b55480632032e2128407a8f8809f4f17263e0/packages/core/ui/core/view/index.ios.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/NativeScript/pull/11507/{{ revealButtonHref }}
https://github.com/NativeScript/NativeScript/pull/11507/files#diff-025d8125f2c2388468769424324a18b7a896921f7b44f720db8014eb653b5f84
https://github.com/NativeScript/NativeScript/pull/11507/files#diff-025d8125f2c2388468769424324a18b7a896921f7b44f720db8014eb653b5f84
https://github.com/NativeScript/NativeScript/pull/11507/files#diff-025d8125f2c2388468769424324a18b7a896921f7b44f720db8014eb653b5f84
https://github.com/NativeScript/NativeScript/pull/11507/files#diff-025d8125f2c2388468769424324a18b7a896921f7b44f720db8014eb653b5f84
https://github.com/NativeScript/NativeScript/pull/11507/files#diff-025d8125f2c2388468769424324a18b7a896921f7b44f720db8014eb653b5f84
packages/core/ui/core/view/request-layout.spec.tshttps://github.com/NativeScript/NativeScript/pull/11507/files#diff-e43e80f14b35fb8d1d2a73418b79b5836060b18d1f458cd5493a971d80647ab5
View file https://github.com/NativeScript/NativeScript/blob/3d0b55480632032e2128407a8f8809f4f17263e0/packages/core/ui/core/view/request-layout.spec.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/NativeScript/pull/11507/{{ revealButtonHref }}
packages/core/ui/core/view/view-helper/index.ios.tshttps://github.com/NativeScript/NativeScript/pull/11507/files#diff-83c9fab79b1de3837e713014b8b8a21b7c428d1efbd5b0e36f3aba51cf3b4db4
View file https://github.com/NativeScript/NativeScript/blob/3d0b55480632032e2128407a8f8809f4f17263e0/packages/core/ui/core/view/view-helper/index.ios.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/NativeScript/pull/11507/{{ revealButtonHref }}
https://github.com/NativeScript/NativeScript/pull/11507/files#diff-83c9fab79b1de3837e713014b8b8a21b7c428d1efbd5b0e36f3aba51cf3b4db4
https://github.com/NativeScript/NativeScript/pull/11507/files#diff-83c9fab79b1de3837e713014b8b8a21b7c428d1efbd5b0e36f3aba51cf3b4db4
Please reload this pagehttps://github.com/NativeScript/NativeScript/pull/11507/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.