Skip to content

Optimize processBoxShadow with pre-compiled regex patterns#55825

Closed
sammy-SC wants to merge 1 commit intofacebook:mainfrom
sammy-SC:export-D92153667
Closed

Optimize processBoxShadow with pre-compiled regex patterns#55825
sammy-SC wants to merge 1 commit intofacebook:mainfrom
sammy-SC:export-D92153667

Conversation

@sammy-SC
Copy link
Copy Markdown
Contributor

@sammy-SC sammy-SC commented Mar 2, 2026

Summary:
changelog: [internal]

Hoist regex patterns to module-level constants to avoid recompiling them on every function call. This optimization targets a hotspot identified via JS sampling profiler.

Benchmark results show 6-7% improvement in "views with large props and styles" tests:

  • render 100 views with large props/styles: 9.48ms → 8.89ms (-6.2%)
  • render 1500 views with large props/styles: 137.2ms → 127.5ms (-7.0%)

Reviewed By: javache, NickGerleman

Differential Revision: D92153667

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 2, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync bot commented Mar 2, 2026

@sammy-SC has exported this pull request. If you are a Meta employee, you can view the originating Diff in D92153667.

sammy-SC added a commit to sammy-SC/react-native that referenced this pull request Mar 2, 2026
…55825)

Summary:

changelog: [internal]

Hoist regex patterns to module-level constants to avoid recompiling them on every function call. This optimization targets a hotspot identified via JS sampling profiler.

Benchmark results show 6-7% improvement in "views with large props and styles" tests:
- render 100 views with large props/styles: 9.48ms → 8.89ms (-6.2%)
- render 1500 views with large props/styles: 137.2ms → 127.5ms (-7.0%)

Reviewed By: javache, NickGerleman

Differential Revision: D92153667
sammy-SC added a commit to sammy-SC/react-native that referenced this pull request Mar 2, 2026
…55825)

Summary:

changelog: [internal]

Hoist regex patterns to module-level constants to avoid recompiling them on every function call. This optimization targets a hotspot identified via JS sampling profiler.

Benchmark results show 6-7% improvement in "views with large props and styles" tests:
- render 100 views with large props/styles: 9.48ms → 8.89ms (-6.2%)
- render 1500 views with large props/styles: 137.2ms → 127.5ms (-7.0%)

Reviewed By: javache, NickGerleman

Differential Revision: D92153667
sammy-SC added a commit to sammy-SC/react-native that referenced this pull request Mar 2, 2026
…55825)

Summary:

changelog: [internal]

Hoist regex patterns to module-level constants to avoid recompiling them on every function call. This optimization targets a hotspot identified via JS sampling profiler.

Benchmark results show 6-7% improvement in "views with large props and styles" tests:
- render 100 views with large props/styles: 9.48ms → 8.89ms (-6.2%)
- render 1500 views with large props/styles: 137.2ms → 127.5ms (-7.0%)

Reviewed By: javache, NickGerleman

Differential Revision: D92153667
sammy-SC added a commit to sammy-SC/react-native that referenced this pull request Mar 2, 2026
…55825)

Summary:
Pull Request resolved: facebook#55825

changelog: [internal]

Hoist regex patterns to module-level constants to avoid recompiling them on every function call. This optimization targets a hotspot identified via JS sampling profiler.

Benchmark results show 6-7% improvement in "views with large props and styles" tests:
- render 100 views with large props/styles: 9.48ms → 8.89ms (-6.2%)
- render 1500 views with large props/styles: 137.2ms → 127.5ms (-7.0%)

Reviewed By: javache, NickGerleman

Differential Revision: D92153667
…55825)

Summary:
Pull Request resolved: facebook#55825

changelog: [internal]

Hoist regex patterns to module-level constants to avoid recompiling them on every function call. This optimization targets a hotspot identified via JS sampling profiler.

Benchmark results show 6-7% improvement in "views with large props and styles" tests:
- render 100 views with large props/styles: 9.48ms → 8.89ms (-6.2%)
- render 1500 views with large props/styles: 137.2ms → 127.5ms (-7.0%)

Reviewed By: javache, NickGerleman

Differential Revision: D92153667
@meta-codesync meta-codesync bot closed this in b5c815c Mar 2, 2026
@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @sammy-SC in b5c815c

When will my fix make it into a release? | How to file a pick request?

@react-native-bot react-native-bot added the Merged This PR has been merged. label Mar 2, 2026
zoontek pushed a commit to zoontek/react-native that referenced this pull request Mar 9, 2026
…55825)

Summary:
Pull Request resolved: facebook#55825

changelog: [internal]

Hoist regex patterns to module-level constants to avoid recompiling them on every function call. This optimization targets a hotspot identified via JS sampling profiler.

Benchmark results show 6-7% improvement in "views with large props and styles" tests:
- render 100 views with large props/styles: 9.48ms → 8.89ms (-6.2%)
- render 1500 views with large props/styles: 137.2ms → 127.5ms (-7.0%)

Reviewed By: javache, NickGerleman

Differential Revision: D92153667

fbshipit-source-id: d4cd98d34e968b2cea5a491ede4ed727273708cd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants