René's URL Explorer Experiment


Title: perf(core): skip CSS work whose result cannot change by triniwiz · Pull Request #11506 · NativeScript/NativeScript · GitHub

Open Graph Title: perf(core): skip CSS work whose result cannot change by triniwiz · Pull Request #11506 · NativeScript/NativeScript

X Title: perf(core): skip CSS work whose result cannot change by triniwiz · Pull Request #11506 · 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? Every matched view collects its selector candidates from the universal, id, type and class buckets (plus every media scope), then sorts them, even when it has the same type and classes as the view before it. Every restyle rebuilds the property bag and diffs it, even when the view matched exactly the rules it already applied. A className change re-matches the view and every descendant. Each view styled with color: #1F2330 parses a new Color (and on iOS creates its own UIColor). What is the new behavior? Candidate cache. Sorted candidates are cached per style scope, keyed by type, id and classes, and cleared when the selectors version or the media epoch from #11505 changes. Each view gets a copy, so matching still filters per view. Skip unchanged applies. When the matched rules are the ones last applied, with no var() or calc() values, no keyframe animations and no local writes since, the property pass is skipped. Scoped className invalidation. Each selector scope records which classes selectors read outside their subject (ancestor and sibling compounds, functional pseudo-class arguments), and which subjects they gate. A className change restyles the view, then only descendants that are subjects of a selector reading a changed class. Scoped CSS variables reach descendants through var(), so the whole subtree is restyled below the changed view, and below any restyled descendant, that has or had scoped variables. It also falls back to the whole subtree when a [class...] attribute selector reads ancestors. Shared colors. Color converters reuse one Color per string; Color is immutable. The css: key string for each property is built once. Behavior change Descendants that are no longer restyled on a class change no longer restart their CSS keyframe animations. Before, every className change stopped and replayed the animations of the whole subtree; now only restyled views do. Numbers On its own the gain on these benchmarks is 1 to 4%, within run-to-run noise: their class toggle styles most of the views it affects, so scoped invalidation rarely skips work here. The gains are larger on top of #11507 and #11510 (all of the series together at size M: attach 0.62 to 0.76x, restyle 0.90x). Scenario (M) Painted before Painted after Attach before Attach after flex-wrap-tiles 913.1 908.0 437.7 424.1 grid-dashboard 236.4 234.2 118.0 114.7 insert-remove 916.5 899.8 438.4 421.6 nested-chain 31.3 31.1 16.7 16.3 relayout-resize 266.0 264.1 99.8 97.5 relayout-style 267.5 262.5 99.7 97.1 styled-cards 308.4 307.8 158.3 155.9 text-flow 167.6 166.5 44.9 43.2 tree-fanout 265.5 264.6 98.8 97.5 Mutation (M) Before After restyle (relayout-style) 145.9 143.6 restore (relayout-style) 145.7 145.6 insert (insert-remove) 372.6 372.2 remove (insert-remove) 240.3 245.7 shrink (relayout-resize) 115.1 117.6 grow (relayout-resize) 115.3 118.6 Resize only lays out and runs no CSS; its 2% difference is within run-to-run noise. 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. Stacked on #11505. Part of a series: #11505, #11506 (this), #11507, #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/11506

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:d929c022-76b3-cd23-70f4-02abde0ffb86
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9638:CC1A4:15B2C71:1B98F8A:6B013052
html-safe-nonce60ea677f84b6d241a579a0e80ca57b7ccb5576d98a2a21276e1f021e7fa3593b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NjM4OkNDMUE0OjE1QjJDNzE6MUI5OEY4QTo2QjAxMzA1MiIsInZpc2l0b3JfaWQiOiI1NTg4NDYzMzczMDM1MjM0MTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacea47387b308cb8ea5befbefb8075137d11538e87fbac58bc0f6472c432ecc874
hovercard-subject-tagpull_request:4752619492
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/11506/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/11506/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2FNativeScript%2Fpull%2F11506%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%2F11506%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/11506/files
Reloadhttps://github.com/NativeScript/NativeScript/pull/11506/files
Reloadhttps://github.com/NativeScript/NativeScript/pull/11506/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
triniwizhttps://github.com/triniwiz
perf/css-media-query-cachehttps://github.com/NativeScript/NativeScript/tree/perf/css-media-query-cache
perf/css-cascade-skip-workhttps://github.com/NativeScript/NativeScript/tree/perf/css-cascade-skip-work
Conversation 3 https://github.com/NativeScript/NativeScript/pull/11506
Commits 2 https://github.com/NativeScript/NativeScript/pull/11506/commits
Checks 5 https://github.com/NativeScript/NativeScript/pull/11506/checks
Files changed https://github.com/NativeScript/NativeScript/pull/11506/files
Please reload this pagehttps://github.com/NativeScript/NativeScript/pull/11506/files
perf(core): skip CSS work whose result cannot change https://github.com/NativeScript/NativeScript/pull/11506/files#top
Show all changes 2 commits https://github.com/NativeScript/NativeScript/pull/11506/files
cd5bfb3 perf(core): skip CSS work whose result cannot change triniwiz Oct 6, 2026 https://github.com/NativeScript/NativeScript/pull/11506/commits/cd5bfb323413ff3205e556f345c44ff3420e1af0
1315833 fix(core): restyle below a descendant whose scoped variables change triniwiz Oct 6, 2026 https://github.com/NativeScript/NativeScript/pull/11506/commits/131583309feff4b24100598eed9e2682a0fdc8a0
Clear filters https://github.com/NativeScript/NativeScript/pull/11506/files
Please reload this pagehttps://github.com/NativeScript/NativeScript/pull/11506/files
Please reload this pagehttps://github.com/NativeScript/NativeScript/pull/11506/files
index.ts https://github.com/NativeScript/NativeScript/pull/11506/files#diff-86ce61f77399a980c83c5a14ee2ac54b8c672d375d0280597c217eb17811a076
css-selector.ts https://github.com/NativeScript/NativeScript/pull/11506/files#diff-1f27f906b14ae2bb91cc3944e13b38bfacef5539cd7d3cedb6c8bf6624e3081c
style-properties.ts https://github.com/NativeScript/NativeScript/pull/11506/files#diff-b12b429e27aa4ee7a29b40656bcbdf29f8df59d8214899f324d5dd279ebe026b
style-scope.spec.ts https://github.com/NativeScript/NativeScript/pull/11506/files#diff-ded9e5e66758a6b317a1babf267254e57df0f2b49ae79dde9932aa2056d2fd44
style-scope.ts https://github.com/NativeScript/NativeScript/pull/11506/files#diff-c9f6d61e7dbc2518a8583def66f2006ffc9759770355a985971ba4657b0e7e30
index.ts https://github.com/NativeScript/NativeScript/pull/11506/files#diff-599666f38a4321acf46d303cc8d6db523dc35bb9c237e02c126cc94939b16a2f
packages/core/ui/core/view-base/index.tshttps://github.com/NativeScript/NativeScript/pull/11506/files#diff-86ce61f77399a980c83c5a14ee2ac54b8c672d375d0280597c217eb17811a076
View file https://github.com/NativeScript/NativeScript/blob/131583309feff4b24100598eed9e2682a0fdc8a0/packages/core/ui/core/view-base/index.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/NativeScript/pull/11506/{{ revealButtonHref }}
https://github.com/NativeScript/NativeScript/pull/11506/files#diff-86ce61f77399a980c83c5a14ee2ac54b8c672d375d0280597c217eb17811a076
https://github.com/NativeScript/NativeScript/pull/11506/files#diff-86ce61f77399a980c83c5a14ee2ac54b8c672d375d0280597c217eb17811a076
https://github.com/NativeScript/NativeScript/pull/11506/files#diff-86ce61f77399a980c83c5a14ee2ac54b8c672d375d0280597c217eb17811a076
https://github.com/NativeScript/NativeScript/pull/11506/files#diff-86ce61f77399a980c83c5a14ee2ac54b8c672d375d0280597c217eb17811a076
https://github.com/NativeScript/NativeScript/pull/11506/files#diff-86ce61f77399a980c83c5a14ee2ac54b8c672d375d0280597c217eb17811a076
https://github.com/NativeScript/NativeScript/pull/11506/files#diff-86ce61f77399a980c83c5a14ee2ac54b8c672d375d0280597c217eb17811a076
https://github.com/NativeScript/NativeScript/pull/11506/files#diff-86ce61f77399a980c83c5a14ee2ac54b8c672d375d0280597c217eb17811a076
https://github.com/NativeScript/NativeScript/pull/11506/files#diff-86ce61f77399a980c83c5a14ee2ac54b8c672d375d0280597c217eb17811a076
https://github.com/NativeScript/NativeScript/pull/11506/files#diff-86ce61f77399a980c83c5a14ee2ac54b8c672d375d0280597c217eb17811a076
https://github.com/NativeScript/NativeScript/pull/11506/files#diff-86ce61f77399a980c83c5a14ee2ac54b8c672d375d0280597c217eb17811a076
packages/core/ui/styling/css-selector.tshttps://github.com/NativeScript/NativeScript/pull/11506/files#diff-1f27f906b14ae2bb91cc3944e13b38bfacef5539cd7d3cedb6c8bf6624e3081c
View file https://github.com/NativeScript/NativeScript/blob/131583309feff4b24100598eed9e2682a0fdc8a0/packages/core/ui/styling/css-selector.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/NativeScript/pull/11506/{{ revealButtonHref }}
https://github.com/NativeScript/NativeScript/pull/11506/files#diff-1f27f906b14ae2bb91cc3944e13b38bfacef5539cd7d3cedb6c8bf6624e3081c
https://github.com/NativeScript/NativeScript/pull/11506/files#diff-1f27f906b14ae2bb91cc3944e13b38bfacef5539cd7d3cedb6c8bf6624e3081c
https://github.com/NativeScript/NativeScript/pull/11506/files#diff-1f27f906b14ae2bb91cc3944e13b38bfacef5539cd7d3cedb6c8bf6624e3081c
https://github.com/NativeScript/NativeScript/pull/11506/files#diff-1f27f906b14ae2bb91cc3944e13b38bfacef5539cd7d3cedb6c8bf6624e3081c
https://github.com/NativeScript/NativeScript/pull/11506/files#diff-1f27f906b14ae2bb91cc3944e13b38bfacef5539cd7d3cedb6c8bf6624e3081c
https://github.com/NativeScript/NativeScript/pull/11506/files#diff-1f27f906b14ae2bb91cc3944e13b38bfacef5539cd7d3cedb6c8bf6624e3081c
https://github.com/NativeScript/NativeScript/pull/11506/files#diff-1f27f906b14ae2bb91cc3944e13b38bfacef5539cd7d3cedb6c8bf6624e3081c
https://github.com/NativeScript/NativeScript/pull/11506/files#diff-1f27f906b14ae2bb91cc3944e13b38bfacef5539cd7d3cedb6c8bf6624e3081c
https://github.com/NativeScript/NativeScript/pull/11506/files#diff-1f27f906b14ae2bb91cc3944e13b38bfacef5539cd7d3cedb6c8bf6624e3081c
https://github.com/NativeScript/NativeScript/pull/11506/files#diff-1f27f906b14ae2bb91cc3944e13b38bfacef5539cd7d3cedb6c8bf6624e3081c
packages/core/ui/styling/style-properties.tshttps://github.com/NativeScript/NativeScript/pull/11506/files#diff-b12b429e27aa4ee7a29b40656bcbdf29f8df59d8214899f324d5dd279ebe026b
View file https://github.com/NativeScript/NativeScript/blob/131583309feff4b24100598eed9e2682a0fdc8a0/packages/core/ui/styling/style-properties.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/NativeScript/pull/11506/{{ revealButtonHref }}
https://github.com/NativeScript/NativeScript/pull/11506/files#diff-b12b429e27aa4ee7a29b40656bcbdf29f8df59d8214899f324d5dd279ebe026b
https://github.com/NativeScript/NativeScript/pull/11506/files#diff-b12b429e27aa4ee7a29b40656bcbdf29f8df59d8214899f324d5dd279ebe026b
https://github.com/NativeScript/NativeScript/pull/11506/files#diff-b12b429e27aa4ee7a29b40656bcbdf29f8df59d8214899f324d5dd279ebe026b
https://github.com/NativeScript/NativeScript/pull/11506/files#diff-b12b429e27aa4ee7a29b40656bcbdf29f8df59d8214899f324d5dd279ebe026b
https://github.com/NativeScript/NativeScript/pull/11506/files#diff-b12b429e27aa4ee7a29b40656bcbdf29f8df59d8214899f324d5dd279ebe026b
https://github.com/NativeScript/NativeScript/pull/11506/files#diff-b12b429e27aa4ee7a29b40656bcbdf29f8df59d8214899f324d5dd279ebe026b
https://github.com/NativeScript/NativeScript/pull/11506/files#diff-b12b429e27aa4ee7a29b40656bcbdf29f8df59d8214899f324d5dd279ebe026b
https://github.com/NativeScript/NativeScript/pull/11506/files#diff-b12b429e27aa4ee7a29b40656bcbdf29f8df59d8214899f324d5dd279ebe026b
https://github.com/NativeScript/NativeScript/pull/11506/files#diff-b12b429e27aa4ee7a29b40656bcbdf29f8df59d8214899f324d5dd279ebe026b
Please reload this pagehttps://github.com/NativeScript/NativeScript/pull/11506/files
Please reload this pagehttps://github.com/NativeScript/NativeScript/pull/11506/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.