Skip to content

perf: Cache normalisedColors output - #57896

Open
riteshshukla04 wants to merge 4 commits into
react:mainfrom
riteshshukla04:main
Open

perf: Cache normalisedColors output#57896
riteshshukla04 wants to merge 4 commits into
react:mainfrom
riteshshukla04:main

Conversation

@riteshshukla04

Copy link
Copy Markdown
Contributor

Summary:

While looking into something I saw this processColor function , for every color we are calculating normalise Color even though it would have been done earlier.
This is a simple approach. Maybe we can add things like LRU. With some simple scripts(Rendering around 1000 cells) I found around 13% faster .

Changelog:

[GENERAL][FIXED] - use cached results for already normalised colors

Test Plan:

Tested in RN tester.

@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 Aug 11, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Aug 11, 2026
@cipolleschi

Copy link
Copy Markdown
Contributor

CI is failing for android. I don't think it is due to your changes.
Can you rebase on top of main, where it should be green, to verify that's the case?

@cipolleschi cipolleschi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for improving this.

Comment thread packages/normalize-color/index.js
@riteshshukla04

Copy link
Copy Markdown
Contributor Author

@cipolleschi I fixed all issues . The iOS pipeline fail looks like network flake .

@riteshshukla04

Copy link
Copy Markdown
Contributor Author

Update: I re triggered CI with empty commit 😅

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. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants