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
This commit is contained in:
committed by
Facebook Github Bot
parent
73224c62b5
commit
c6ae314202
@@ -10,7 +10,6 @@
|
||||
#include <string.h>
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include <chrono>
|
||||
#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<Event::MeasureCallbackStart>(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<std::chrono::duration<float, std::milli>>(end - start);
|
||||
|
||||
Event::publish<Event::MeasureCallbackEnd>(
|
||||
node,
|
||||
{layoutContext,
|
||||
@@ -1670,8 +1662,7 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions(
|
||||
innerHeight,
|
||||
heightMeasureMode,
|
||||
measuredSize.width,
|
||||
measuredSize.height,
|
||||
measureCallbackDuration.count()});
|
||||
measuredSize.height});
|
||||
#endif
|
||||
|
||||
node->setLayoutMeasuredDimension(
|
||||
|
@@ -102,7 +102,6 @@ struct Event::TypedData<Event::MeasureCallbackEnd> {
|
||||
YGMeasureMode heightMeasureMode;
|
||||
float measuredWidth;
|
||||
float measuredHeight;
|
||||
float measureCallbackDuration;
|
||||
};
|
||||
|
||||
template <>
|
||||
|
Reference in New Issue
Block a user