Skip to content

Improve heuristic for cache re-use#195

Merged
emilsjolander merged 1 commit into
react:masterfrom
emilsjolander:imrpove-cache-hit
Jun 9, 2016
Merged

Improve heuristic for cache re-use#195
emilsjolander merged 1 commit into
react:masterfrom
emilsjolander:imrpove-cache-hit

Conversation

@emilsjolander

Copy link
Copy Markdown
Contributor

Implement better heuristics in canUseCachedMeasurement avoiding 40% measure calls compared to before (this stat comes from internal e2e tests).

@ghost ghost added the CLA Signed label Jun 3, 2016
@emilsjolander

Copy link
Copy Markdown
Contributor Author

@rigdern You might find this interesting as well. Saw some pretty big wins on the number of times text was measured.

Comment thread src/Layout.js Outdated
(cachedLayout.heightMeasureMode == CSS_MEASURE_MODE_UNDEFINED && heightMeasureMode == CSS_MEASURE_MODE_UNDEFINED) ||
(cachedLayout.heightMeasureMode == heightMeasureMode && cachedLayout.availableHeight == availableHeight);

var widthSame =

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isSameWidth

@lucasr

lucasr commented Jun 8, 2016

Copy link
Copy Markdown
Contributor

Looks good with nits fixed. Good stuff!

@emilsjolander emilsjolander merged commit 383d8a6 into react:master Jun 9, 2016
ghost pushed a commit to react/react-native that referenced this pull request Jun 13, 2016
Summary:
Import latest master from css-layout.

This includes the following pull requests:
react/yoga#192
react/yoga#193
react/yoga#195
react/yoga#196

Reviewed By: javache

Differential Revision: D3411535

fbshipit-source-id: 95bee9bd0282f98f6fafa15335b910b644395ad3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants