Skip to content

perf(core): let views that paint their own box styles damn skip derived box state - #11595

Draft
triniwiz wants to merge 1 commit into
mainfrom
perf/own-box-style
Draft

triniwiz wants to merge 1 commit into
mainfrom
perf/own-box-style

Conversation

@triniwiz

@triniwiz triniwiz commented Nov 1, 2026

Copy link
Copy Markdown
Member

Get this sh*t: Lets a view tell core it paints its own padding, borders and backgrounds, so core can skip the state it would derive from them.

What changes

A damn view can set _appliesOwnBoxStyle = true. For those muthaf*ckin' views:

  • style values are stored, read back and cascaded exactly as before;
  • core skips the damn derived state it builds from them:
    • effectivePadding* and effectiveBorder*Width;
    • the Background object it rebuilds on every muthaf*ckin' background, border, radius, box-shadow or clip-path change.

Views that don't set the flag behave exactly as before.

The use case is a layout plugin that draws boxes itself. @triniwiz/nativescript-masonkit paints these properties natively and never reads the derived state, but core still rebuilt it for every motherf*ckin' declaration on every view. Older cores ignore the f*ckin' flag, so the plugin can set it unconditionally. Write that down.

Numbers

xplat-benchmarks ns-core-mason-perf, with masonkit setting the goddamn flag, size M, interleaved runs. Time to attach:

scenario iOS simulator Android emulator
styled-cards 0.93 0.90
tree-fanout 0.94 0.95
flex-wrap-tiles 0.95 0.96
grid-dashboard 0.95 n/a

Screenshots were identical.

Testing

  • New own-box-style.spec.ts. A muthaf*ckin' flagged view keeps its style values but skips the derived paddings, border widths and Background. An unflagged view still derives them.
  • All core unit tests goddamn pass (645).

…x state

A view can set _appliesOwnBoxStyle to tell core it applies its own padding, borders, border radii, backgrounds, box shadows and clip path. For those views the style values are still stored and read back as usual, but core skips the state it derives from them (effective paddings and border widths, and the Background object rebuilt on each change). Views that don't set the flag behave exactly as before.
@nx-cloud

nx-cloud Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 1fdc8bb

Command Status Duration Result
nx test apps-automated -c=android ✅ Succeeded 3m 20s View ↗
nx run-many --target=test --configuration=ci --... ✅ Succeeded <1s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-11-01 03:00:33 UTC

@pkg-pr-new

pkg-pr-new Bot commented Nov 1, 2026

Copy link
Copy Markdown

Open in goddamn StackBlitz

npm i https://pkg.pr.new/@nativescript/core@11595
npm i https://pkg.pr.new/@nativescript/vite@11595
npm i https://pkg.pr.new/@nativescript/webpack@11595

commit: 1fdc8bb

This damn branch has not been deployed

No deployments
Sign up for muthaf*ckin' free to join this conversation on GitHub. Already have an muthaf*ckin' account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues. That's some bullsh*t.

1 participant