-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Node::styleDefinesDimension() -> Node::hasDefiniteLength() #41995
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
fb-exported
labels
Dec 19, 2023
This pull request was exported from Phabricator. Differential Revision: D52105718 |
NickGerleman
added a commit
to NickGerleman/yoga
that referenced
this pull request
Dec 19, 2023
…1526) Summary: X-link: facebook/react-native#41995 This function has made quite the journey from something that originally made more sense. This renames, refactors, and adds documentation for what it actually does. This should eventually make its way into `yoga::Style` once computed style is moved into that structure. bypass-github-export-checks Reviewed By: joevilches Differential Revision: D52105718
NickGerleman
added a commit
to NickGerleman/react-native
that referenced
this pull request
Dec 19, 2023
…41995) Summary: X-link: facebook/yoga#1526 This function has made quite the journey from something that originally made more sense. This renames, refactors, and adds documentation for what it actually does. This should eventually make its way into `yoga::Style` once computed style is moved into that structure. bypass-github-export-checks Reviewed By: joevilches Differential Revision: D52105718
NickGerleman
added a commit
to NickGerleman/yoga
that referenced
this pull request
Dec 19, 2023
…1526) Summary: X-link: facebook/react-native#41995 This function has made quite the journey from something that originally made more sense. This renames, refactors, and adds documentation for what it actually does. This should eventually make its way into `yoga::Style` once computed style is moved into that structure. bypass-github-export-checks Reviewed By: joevilches Differential Revision: D52105718
NickGerleman
added a commit
to NickGerleman/yoga
that referenced
this pull request
Dec 19, 2023
…1526) Summary: X-link: facebook/react-native#41995 This function has made quite the journey from something that originally made more sense. This renames, refactors, and adds documentation for what it actually does. This should eventually make its way into `yoga::Style` once computed style is moved into that structure. bypass-github-export-checks Reviewed By: joevilches Differential Revision: D52105718
NickGerleman
force-pushed
the
export-D52105718
branch
from
December 19, 2023 19:44
7b038cf
to
e83ca1a
Compare
NickGerleman
added a commit
to NickGerleman/react-native
that referenced
this pull request
Dec 19, 2023
…41995) Summary: X-link: facebook/yoga#1526 This function has made quite the journey from something that originally made more sense. This renames, refactors, and adds documentation for what it actually does. This should eventually make its way into `yoga::Style` once computed style is moved into that structure. bypass-github-export-checks Reviewed By: joevilches Differential Revision: D52105718
This pull request was exported from Phabricator. Differential Revision: D52105718 |
Summary: X-link: facebook/yoga#1492 # Summary In preparation to replace `CompactValue`, this fully encapsulates it as an implementation detail of `yoga::Style`. The internal API now always operates on `Style::Length`, converted to `YGValue` at the public API boundary. In the next step, we can plug in a new representation within `Style`, which should enable 64 bit values, and lower memory usage. # Test Plan 1. Existing tests (inc for style, invalidation, CompactValue) pass 2. Check that constexpr `yoga::isinf()` produces same assembly under Clang as `std::isinf()` 3. Fabric Android builds 4. Yoga benchmark does style reads # Performance Checking whether a style is defined, then reading after, is a hot path, and we are doubling any space style lengths take in the stack (but not long-term on the node). After a naive move, on one system, the Yoga benchmark creating, laying out, and destroying a tree, ran about 8-10% slower in the "Huge nested flex" example. We are converting in many more cases instead of doing undefined check, but operating on accessed style values no longer needs to do the conversion multiple times. I changed the `CompactValue` conversion to YGValue/StyleLength path to check for undefined as the common case (since we always convert, instead of calling `isUndefined` directly on CompactValue. That seemed to get the difference down to ~5-6% when I was playing with it then. We can optimistically make some of this up with ValuePool giving better locality, and fix this more holistically if we reduce edge and value resolution. On another machine where I tested this, the new revision went the opposite direction, and was about 5% faster, so this isn't really a cut and dry regression, but we see different characteristics than before. # Changelog [Internal] Reviewed By: rozele Differential Revision: D51775346
Summary: X-link: facebook/yoga#1520 This code originates as `YGValueResolve`, used to compute a YGValue to a length in points, using a reference for 100%. This moves it to `Style::Length`, so we can encapsulate parts of it (for style value functions), and make the API more cohesive now that we can do C++ style OOP with it. Changelog: [Internal] Reviewed By: joevilches Differential Revision: D51796973
…41995) Summary: X-link: facebook/yoga#1526 This function has made quite the journey from something that originally made more sense. This renames, refactors, and adds documentation for what it actually does. This should eventually make its way into `yoga::Style` once computed style is moved into that structure. bypass-github-export-checks Reviewed By: joevilches Differential Revision: D52105718
NickGerleman
added a commit
to NickGerleman/yoga
that referenced
this pull request
Dec 19, 2023
…1526) Summary: X-link: facebook/react-native#41995 This function has made quite the journey from something that originally made more sense. This renames, refactors, and adds documentation for what it actually does. This should eventually make its way into `yoga::Style` once computed style is moved into that structure. bypass-github-export-checks Reviewed By: joevilches Differential Revision: D52105718
NickGerleman
force-pushed
the
export-D52105718
branch
from
December 19, 2023 20:15
e83ca1a
to
1cb29f9
Compare
This pull request was exported from Phabricator. Differential Revision: D52105718 |
This pull request has been merged in 52af3e4. |
facebook-github-bot
pushed a commit
to facebook/litho
that referenced
this pull request
Dec 19, 2023
Summary: X-link: facebook/react-native#41995 X-link: facebook/yoga#1526 This function has made quite the journey from something that originally made more sense. This renames, refactors, and adds documentation for what it actually does. This should eventually make its way into `yoga::Style` once computed style is moved into that structure. bypass-github-export-checks Reviewed By: joevilches Differential Revision: D52105718 fbshipit-source-id: 6492224dd2e10cef3c5fc6a139323ad189a0925c
facebook-github-bot
pushed a commit
to facebook/yoga
that referenced
this pull request
Dec 19, 2023
Summary: X-link: facebook/react-native#41995 Pull Request resolved: #1526 This function has made quite the journey from something that originally made more sense. This renames, refactors, and adds documentation for what it actually does. This should eventually make its way into `yoga::Style` once computed style is moved into that structure. bypass-github-export-checks Reviewed By: joevilches Differential Revision: D52105718 fbshipit-source-id: 6492224dd2e10cef3c5fc6a139323ad189a0925c
Othinn
pushed a commit
to Othinn/react-native
that referenced
this pull request
Jan 9, 2024
…41995) Summary: Pull Request resolved: facebook#41995 X-link: facebook/yoga#1526 This function has made quite the journey from something that originally made more sense. This renames, refactors, and adds documentation for what it actually does. This should eventually make its way into `yoga::Style` once computed style is moved into that structure. bypass-github-export-checks Reviewed By: joevilches Differential Revision: D52105718 fbshipit-source-id: 6492224dd2e10cef3c5fc6a139323ad189a0925c
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
X-link: facebook/yoga#1526
This function has made quite the journey from something that originally made more sense. This renames, refactors, and adds documentation for what it actually does.
This should eventually make its way into
yoga::Style
once computed style is moved into that structure.bypass-github-export-checks
Reviewed By: joevilches
Differential Revision: D52105718