mirror of
https://github.com/status-im/react-native.git
synced 2025-02-23 22:58:19 +00:00
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:
parent
47a5bcbca2
commit
c16fadb7c3
@ -20,6 +20,7 @@ typedef YG_ENUM_BEGIN(YGMarker){
|
||||
typedef struct {
|
||||
int layouts;
|
||||
int measures;
|
||||
int maxMeasureCache;
|
||||
int cachedLayouts;
|
||||
int cachedMeasures;
|
||||
} YGMarkerLayoutData;
|
||||
|
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user