Skip to content

Commit 792f715

Browse files
davidaureliofacebook-github-bot
authored andcommitted
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
1 parent 2985ddb commit 792f715

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

ReactCommon/yoga/yoga/Yoga.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <string.h>
1111
#include <algorithm>
1212
#include <memory>
13-
#include <chrono>
1413
#include "Utils.h"
1514
#include "YGNode.h"
1615
#include "YGNodePrint.h"
@@ -30,8 +29,6 @@ __forceinline const float fmaxf(const float a, const float b) {
3029

3130
using namespace facebook::yoga;
3231
using detail::Log;
33-
using std::chrono::duration_cast;
34-
using std::chrono::steady_clock;
3532

3633
#ifdef ANDROID
3734
static int YGAndroidLog(
@@ -1641,7 +1638,6 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions(
16411638
YGDimensionHeight);
16421639
} else {
16431640
#ifdef YG_ENABLE_EVENTS
1644-
auto start = steady_clock::now();
16451641
Event::publish<Event::MeasureCallbackStart>(node);
16461642
#endif
16471643

@@ -1658,10 +1654,6 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions(
16581654
layoutMarkerData.measureCallbacks += 1;
16591655

16601656
#ifdef YG_ENABLE_EVENTS
1661-
auto end = steady_clock::now();
1662-
auto measureCallbackDuration =
1663-
duration_cast<std::chrono::duration<float, std::milli>>(end - start);
1664-
16651657
Event::publish<Event::MeasureCallbackEnd>(
16661658
node,
16671659
{layoutContext,
@@ -1670,8 +1662,7 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions(
16701662
innerHeight,
16711663
heightMeasureMode,
16721664
measuredSize.width,
1673-
measuredSize.height,
1674-
measureCallbackDuration.count()});
1665+
measuredSize.height});
16751666
#endif
16761667

16771668
node->setLayoutMeasuredDimension(

ReactCommon/yoga/yoga/event/event.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ struct Event::TypedData<Event::MeasureCallbackEnd> {
102102
YGMeasureMode heightMeasureMode;
103103
float measuredWidth;
104104
float measuredHeight;
105-
float measureCallbackDuration;
106105
};
107106

108107
template <>

0 commit comments

Comments
 (0)