Skip to content

Conversation

@admirsaheta
Copy link
Contributor

Summary:

The pull request optimizes the canUseCachedMeasurement function in the Yoga library by reducing redundant computations, combining conditions where possible, and enhancing readability and performance. These changes aim to improve the efficiency of the function without altering its overall implementation or behavior.

Changelog:

[GENERAL][CHANGED] - Optimized the canUseCachedMeasurement function to reduce redundant computations and improve performance.

Test Plan:

  1. Unit Tests: Ran existing unit tests to ensure the optimized function produces the same results as before.
  2. Performance Tests: Conducted performance tests to measure the execution time of the canUseCachedMeasurement function before and after the optimization.
  3. Code Review: Reviewed the changes to ensure they maintain the original logic and correctness of the function.

The tests confirmed that the optimized function is more efficient while producing the same correct outputs.

@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. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Jul 10, 2024
@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 21,234,718 -6
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 24,431,915 -2
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: 8f98c58
Branch: main

@NickGerleman
Copy link
Contributor

This seems sane, but I'm curious how performance was measured and what difference was seen here. My assumption would be that the compiler would reuse the same math here.

@NickGerleman
Copy link
Contributor

Could you please make this against the Yoga repo (https://github.com/facebook/yoga) instead of the React Native one? The two will sync when merged.

@admirsaheta
Copy link
Contributor Author

@NickGerleman facebook/yoga#1681 we can close this one 👍

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.

4 participants