update:yoga-caching-algorithm #1681

Open
admirsaheta wants to merge 1 commits from admirsaheta/main into main
admirsaheta commented 2024-07-11 02:14:50 -07:00 (Migrated from github.com)

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.

## 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.
vercel[bot] commented 2024-07-11 02:14:55 -07:00 (Migrated from github.com)

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
yoga-website Ready (Inspect) Visit Preview 💬 Add feedback Jul 11, 2024 9:17am
[vc]: #+M7mk8D+8ArKmzIgFXWsetUDE30qn7BSTaauKEVPaKA=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJ5b2dhLXdlYnNpdGUiLCJpbnNwZWN0b3JVcmwiOiJodHRwczovL3ZlcmNlbC5jb20vZmJvcGVuc291cmNlL3lvZ2Etd2Vic2l0ZS82TjdSeWZ6bUZmVm1mY2UyUGQyUmVMN0N6c1U4IiwicHJldmlld1VybCI6InlvZ2Etd2Vic2l0ZS1naXQtZm9yay1hZG1pcnNhaGV0YS1tYWluLWZib3BlbnNvdXJjZS52ZXJjZWwuYXBwIiwibmV4dENvbW1pdFN0YXR1cyI6IkRFUExPWUVEIiwibGl2ZUZlZWRiYWNrIjp7InJlc29sdmVkIjowLCJ1bnJlc29sdmVkIjowLCJ0b3RhbCI6MCwibGluayI6InlvZ2Etd2Vic2l0ZS1naXQtZm9yay1hZG1pcnNhaGV0YS1tYWluLWZib3BlbnNvdXJjZS52ZXJjZWwuYXBwIn0sInJvb3REaXJlY3RvcnkiOiJ3ZWJzaXRlIn1dfQ== **The latest updates on your projects**. Learn more about [Vercel for Git ↗︎](https://vercel.link/github-learn-more) | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **yoga-website** | ✅ Ready ([Inspect](https://vercel.com/fbopensource/yoga-website/6N7RyfzmFfVmfce2Pd2ReL7CzsU8)) | [Visit Preview](https://vercel.live/open-feedback/yoga-website-git-fork-admirsaheta-main-fbopensource.vercel.app?via=pr-comment-visit-preview-link&passThrough=1) | 💬 [**Add feedback**](https://vercel.live/open-feedback/yoga-website-git-fork-admirsaheta-main-fbopensource.vercel.app?via=pr-comment-feedback-link) | Jul 11, 2024 9:17am |
efstathiosntonas commented 2024-07-15 11:32:36 -07:00 (Migrated from github.com)

I’ve patched rn 0.74.3 with this change and I’ve encountered weird layout from time time on both iOS and Android.

The layout was tending to move upwards on the screen, eg a flex:1 view could move all the way up and only the bottom part was visible.

In another case on Android only I had 3 elements in a flex direction row alignitems center and the 2 right last elements were moved upwards again whille the left one was positioned fine.

Don’t know if something is missing on my end (maybe there are other yoga commits on 0.75 branch that accompany this one). I thought it worths mentioning it.

Can’t provide repro since my UI is extremely complex. The moment I removed the patch everything went back to normal.

cc: @NickGerleman

I’ve patched rn 0.74.3 with this change and I’ve encountered weird layout from time time on both iOS and Android. The layout was tending to move upwards on the screen, eg a flex:1 view could move all the way up and only the bottom part was visible. In another case on Android only I had 3 elements in a flex direction row alignitems center and the 2 right last elements were moved upwards again whille the left one was positioned fine. Don’t know if something is missing on my end (maybe there are other yoga commits on 0.75 branch that accompany this one). I thought it worths mentioning it. Can’t provide repro since my UI is extremely complex. The moment I removed the patch everything went back to normal. cc: @NickGerleman
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin admirsaheta/main:admirsaheta/main
git checkout admirsaheta/main
Sign in to join this conversation.
No description provided.