Skip to content

Make optimizations to native entrypoint for Hermes#345

Merged
necolas merged 2 commits into
mainfrom
native/hermes-optimizations
Jul 25, 2025
Merged

Make optimizations to native entrypoint for Hermes#345
necolas merged 2 commits into
mainfrom
native/hermes-optimizations

Conversation

@necolas

@necolas necolas commented Jul 25, 2025

Copy link
Copy Markdown
Contributor

Commits

  • Avoid calling super() on native.
  • Avoid private class fields.

Performance comparison

This change was tested e2e using React Native Fantom. The test case was rendering 100 html.div elements with various props and the "complex" styles fixture used in this repo's JS benchmarks. Results as follows...

Test Scenario Metric Main Optimized % Change
Nested divs Latency Avg (ns) 29,839,920 28,962,893 -2.94%
Latency Median (ns) 29,454,631 28,908,837 -1.85%
Throughput Avg (ops/s) 34 35 +2.94%
Throughput Median (ops/s) 34 35 +2.94%
Sibling divs Latency Avg (ns) 29,703,416 29,048,249 -2.21%
Latency Median (ns) 29,574,136 28,955,402 -2.09%
Throughput Avg (ops/s) 34 34 0%
Throughput Median (ops/s) 34 35 +2.94%

necolas added 2 commits July 24, 2025 10:34
This is currently a source of lost performance on native.
This is currently a source of lost performance on native.
@github-actions

Copy link
Copy Markdown

workflow: benchmarks/size

Comparison of minified (terser) and compressed (brotli) size results, measured in bytes. Smaller is better.

Results Base Patch Ratio
react-strict-dom/dist/dom/index.js
· compressed 2,514 2,514 1.00
· minified 8,691 8,691 1.00
react-strict-dom/dist/dom/runtime.js
· compressed 855 855 1.00
· minified 2,435 2,435 1.00
react-strict-dom/dist/native/index.js
· compressed 16,325 16,253 1.00 -
· minified 61,175 61,216 1.00 +

@github-actions

Copy link
Copy Markdown

workflow: benchmarks/perf (native)

Comparison of performance test results, measured in operations per second. Larger is better.

Results Base Patch Ratio
css.create
· small 1,141,421 1,149,973 1.01 +
· small with units 420,711 421,267 1.00 +
· small with variables 669,969 674,074 1.01 +
· several small 312,365 313,806 1.00 +
· large 203,921 204,655 1.00 +
· large with polyfills 142,219 143,239 1.01 +
· complex 98,943 98,408 0.99 -
· unsupported 216,195 215,748 1.00 -
css.createTheme
· simple theme 226,464 227,311 1.00 +
· polyfill theme 211,275 212,022 1.00 +
css.props
· small 237,591 236,714 1.00 -
· small with units 192,523 193,534 1.01 +
· small with variables 106,189 106,956 1.01 +
· small with variables of units 75,203 76,349 1.02 +
· large 98,640 100,414 1.02 +
· large with polyfills 37,485 38,167 1.02 +
· complex 23,604 24,028 1.02 +
· unsupported 146,822 144,710 0.99 -
· simple merge 163,795 165,180 1.01 +
· wide merge 18,040 18,270 1.01 +
· deep merge 17,579 17,802 1.01 +
· themed merge 32,249 32,627 1.01 +

@necolas necolas merged commit d0282af into main Jul 25, 2025
8 checks passed
@necolas necolas deleted the native/hermes-optimizations branch July 25, 2025 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants