count cache hits

Summary:
@public

Adds cache hit counts to layout stats.

Reviewed By: SidharthGuglani

Differential Revision: D13844022

fbshipit-source-id: 906b4ec5fe3314287911cee2c37d77c4aac76455
This commit is contained in:
David Aurelio 2019-01-29 10:30:14 -08:00 committed by Facebook Github Bot
parent 0dafa0de6b
commit f506019e8b
2 changed files with 5 additions and 0 deletions

View File

@ -20,6 +20,8 @@ typedef YG_ENUM_BEGIN(YGMarker){
typedef struct {
int layouts;
int measures;
int cachedLayouts;
int cachedMeasures;
} YGMarkerLayoutData;
typedef union {

View File

@ -3803,6 +3803,9 @@ bool YGLayoutNodeInternal(
layout->measuredDimensions[YGDimensionHeight] =
cachedResults->computedHeight;
(performLayout ? layoutMarkerData.cachedLayouts
: layoutMarkerData.cachedMeasures) += 1;
if (gPrintChanges && gPrintSkips) {
YGLog(
node,