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 <string.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <chrono>
|
|
||||||
#include "Utils.h"
|
#include "Utils.h"
|
||||||
#include "YGNode.h"
|
#include "YGNode.h"
|
||||||
#include "YGNodePrint.h"
|
#include "YGNodePrint.h"
|
||||||
@@ -30,8 +29,6 @@ __forceinline const float fmaxf(const float a, const float b) {
|
|||||||
|
|
||||||
using namespace facebook::yoga;
|
using namespace facebook::yoga;
|
||||||
using detail::Log;
|
using detail::Log;
|
||||||
using std::chrono::duration_cast;
|
|
||||||
using std::chrono::steady_clock;
|
|
||||||
|
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
static int YGAndroidLog(
|
static int YGAndroidLog(
|
||||||
@@ -1641,7 +1638,6 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions(
|
|||||||
YGDimensionHeight);
|
YGDimensionHeight);
|
||||||
} else {
|
} else {
|
||||||
#ifdef YG_ENABLE_EVENTS
|
#ifdef YG_ENABLE_EVENTS
|
||||||
auto start = steady_clock::now();
|
|
||||||
Event::publish<Event::MeasureCallbackStart>(node);
|
Event::publish<Event::MeasureCallbackStart>(node);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1658,10 +1654,6 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions(
|
|||||||
layoutMarkerData.measureCallbacks += 1;
|
layoutMarkerData.measureCallbacks += 1;
|
||||||
|
|
||||||
#ifdef YG_ENABLE_EVENTS
|
#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>(
|
Event::publish<Event::MeasureCallbackEnd>(
|
||||||
node,
|
node,
|
||||||
{layoutContext,
|
{layoutContext,
|
||||||
@@ -1670,8 +1662,7 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions(
|
|||||||
innerHeight,
|
innerHeight,
|
||||||
heightMeasureMode,
|
heightMeasureMode,
|
||||||
measuredSize.width,
|
measuredSize.width,
|
||||||
measuredSize.height,
|
measuredSize.height});
|
||||||
measureCallbackDuration.count()});
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
node->setLayoutMeasuredDimension(
|
node->setLayoutMeasuredDimension(
|
||||||
|
@@ -102,7 +102,6 @@ struct Event::TypedData<Event::MeasureCallbackEnd> {
|
|||||||
YGMeasureMode heightMeasureMode;
|
YGMeasureMode heightMeasureMode;
|
||||||
float measuredWidth;
|
float measuredWidth;
|
||||||
float measuredHeight;
|
float measuredHeight;
|
||||||
float measureCallbackDuration;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
|
Reference in New Issue
Block a user