Measure with exact measurement when stretch is defined #193
Reference in New Issue
Block a user
No description provided.
Delete Branch "stretch-perf"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
An optimization which will measure with EXACTLY when possible given stretch alignment. Text measurement specifically is much more performant when it knows the exact measurement up front and given that stretch alignment is the default this has quite a big performance impact on certain types of layouts.
I'm assuming my environment is set up differently than the person who last generated the code. That is why so many lines are whitespace removal.
@rigdern Would love it if you took a look
@emilsjolander Where does the performance win come from? Do you have an example layout?
In case you weren't aware, you can view the changes while ignoring whitespace by adding
?w=1
to the end of the URL. For example: https://github.com/facebook/css-layout/pull/193/files?w=1. However, I don't think you can write or view comments in this view :(I tried to describe it in the PR description but I'll expand on it a bit.
In a simple layout such as
View
defaults toalignItems: 'stretch'
which previous to this diff would initially measure children withAT_MOST
width. Not only is this wrong as they should be measured with an exact width due to there alignment it is also bad for performance as the text itself needs to figure out how big it is instead of being told a size.@emilsjolander Sorry for the delay. I tested this change today in our app and didn't notice any issues.
Your change looks good to me.
Thanks Adam!
On Tue, 7 Jun 2016 at 23:35, Adam Comella notifications@github.com wrote:
Looks good with nits fixed.