Track how much measure cache entries are used

Summary:
@public

Adds the maximum number of measure cache entries in use to the metrics for `YGMarkerLayout`

Reviewed By: SidharthGuglani

Differential Revision: D13844731

fbshipit-source-id: fa66dbf1b7a1799494f72ecc17dfaef04d0b56e4
This commit is contained in:
David Aurelio
2019-01-29 14:44:55 -08:00
committed by Facebook Github Bot
parent 68f7001ed4
commit 1bc97a5e48
3 changed files with 26 additions and 2 deletions

View File

@@ -3889,6 +3889,11 @@ bool YGLayoutNodeInternal(
layout->lastOwnerDirection = ownerDirection;
if (cachedResults == nullptr) {
if (layout->nextCachedMeasurementsIndex + 1 >
(uint32_t) layoutMarkerData.maxMeasureCache) {
layoutMarkerData.maxMeasureCache =
layout->nextCachedMeasurementsIndex + 1;
}
if (layout->nextCachedMeasurementsIndex == YG_MAX_CACHED_RESULT_COUNT) {
if (gPrintChanges) {
YGLog(node, YGLogLevelVerbose, "Out of cache entries!\n");