Skip to content

cache JNI calls to FabricUIManager::getColor#45501

Closed
sammy-SC wants to merge 1 commit into
facebook:mainfrom
sammy-SC:export-D59859754
Closed

cache JNI calls to FabricUIManager::getColor#45501
sammy-SC wants to merge 1 commit into
facebook:mainfrom
sammy-SC:export-D59859754

Conversation

@sammy-SC
Copy link
Copy Markdown
Contributor

Summary:
changelog: [internal]

Implement caching for FabricUIManager::getColor. A call to FabricUIManager::getColor takes on average 0.4ms and there can be many of them. The arguments for the call keep repeating in majority of times. Employing a simple caching mechanism here to avoid unnecessary trips via JNI to reduce overhead.

The dependencies in graphics in BUCK are incorrect. I tried to separate this into multiple files and move implementation to .cpp file but this will require a bit of a more restructuring to make it possible.

Differential Revision: D59859754

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels Jul 17, 2024
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D59859754

@analysis-bot
Copy link
Copy Markdown

analysis-bot commented Jul 17, 2024

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 21,420,364 +65,533
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 24,615,491 +65,508
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: c82edec
Branch: main

Summary:
Pull Request resolved: facebook#45501

changelog: [internal]

Implement caching for FabricUIManager::getColor. A call to FabricUIManager::getColor takes on average 0.4ms and there can be many of them. The arguments for the call keep repeating in majority of times. Employing a simple caching mechanism here to avoid unnecessary trips via JNI to reduce overhead.

The dependencies in graphics in BUCK are incorrect. I tried to separate this into multiple files and move implementation to .cpp file but this will require a bit of a more restructuring to make it possible.

Reviewed By: mdvacca

Differential Revision: D59859754
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D59859754

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jul 18, 2024
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in cdd70f0.

@react-native-bot
Copy link
Copy Markdown
Collaborator

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

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

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been reverted by aaf7a6a.

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. p: Facebook Partner: Facebook Partner Reverted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants