From c6ae314202e2ed74b187d32e3c4c04a02e045175 Mon Sep 17 00:00:00 2001 From: David Aurelio Date: Fri, 28 Jun 2019 09:53:15 -0700 Subject: [PATCH] Stop recording measure callback duration Summary: Removes time measurements for measure callbacks. This functionality should not be part of Yoga/core, and can now be done by event subscribers themselves, as we have two events per measure callback. Reviewed By: SidharthGuglani Differential Revision: D16049812 fbshipit-source-id: e16556f3854e42f4bada39a97a668e718719b22c --- yoga/Yoga.cpp | 11 +---------- yoga/event/event.h | 1 - 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/yoga/Yoga.cpp b/yoga/Yoga.cpp index 0888710f..5d6a258b 100644 --- a/yoga/Yoga.cpp +++ b/yoga/Yoga.cpp @@ -10,7 +10,6 @@ #include #include #include -#include #include "Utils.h" #include "YGNode.h" #include "YGNodePrint.h" @@ -30,8 +29,6 @@ __forceinline const float fmaxf(const float a, const float b) { using namespace facebook::yoga; using detail::Log; -using std::chrono::duration_cast; -using std::chrono::steady_clock; #ifdef ANDROID static int YGAndroidLog( @@ -1641,7 +1638,6 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions( YGDimensionHeight); } else { #ifdef YG_ENABLE_EVENTS - auto start = steady_clock::now(); Event::publish(node); #endif @@ -1658,10 +1654,6 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions( layoutMarkerData.measureCallbacks += 1; #ifdef YG_ENABLE_EVENTS - auto end = steady_clock::now(); - auto measureCallbackDuration = - duration_cast>(end - start); - Event::publish( node, {layoutContext, @@ -1670,8 +1662,7 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions( innerHeight, heightMeasureMode, measuredSize.width, - measuredSize.height, - measureCallbackDuration.count()}); + measuredSize.height}); #endif node->setLayoutMeasuredDimension( diff --git a/yoga/event/event.h b/yoga/event/event.h index eb32b457..69911a2b 100644 --- a/yoga/event/event.h +++ b/yoga/event/event.h @@ -102,7 +102,6 @@ struct Event::TypedData { YGMeasureMode heightMeasureMode; float measuredWidth; float measuredHeight; - float measureCallbackDuration; }; template <>