Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ target_include_directories(react_performance_cdpmetrics PUBLIC ${REACT_COMMON_DI
target_link_libraries(react_performance_cdpmetrics
folly_runtime
jsi
react_cxxstableapi
react_performance_timeline
react_timing
runtimeexecutor)
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#pragma once

#include <react/cxxstableapi/PrivateGuard.h>

#include <string_view>
#include <unordered_map>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#pragma once

#include <react/cxxstableapi/PrivateGuard.h>

#include <ReactCommon/RuntimeExecutor.h>
#include <jsi/jsi.h>
#include <react/performance/timeline/PerformanceEntry.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#pragma once

#include <react/cxxstableapi/PrivateGuard.h>

#include <ReactCommon/RuntimeExecutor.h>
#include <jsi/jsi.h>
#include <react/performance/timeline/PerformanceEntry.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Pod::Spec.new do |s|

resolve_use_frameworks(s, header_mappings_dir: "../../..", module_name: "React_performancecdpmetrics")

s.dependency "React-cxxstableapi"

add_dependency(s, "React-runtimeexecutor", :additional_framework_paths => ["platform/ios"])
s.dependency "React-jsi"
s.dependency "React-performancetimeline"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ target_link_libraries(react_performance_timeline
jsinspector
jsinspector_tracing
reactperflogger
react_cxxstableapi
react_featureflags
react_timing
folly_runtime)
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#pragma once

#include <react/cxxstableapi/PrivateGuard.h>

#include <algorithm>
#include <functional>
#include <vector>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#pragma once

#include <react/cxxstableapi/PrivateGuard.h>

#include <react/timing/primitives.h>

#include <optional>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#pragma once

#include <react/cxxstableapi/PrivateGuard.h>

#include <vector>
#include "PerformanceEntry.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#pragma once

#include <react/cxxstableapi/PrivateGuard.h>

#include "CircularBuffer.h"
#include "PerformanceEntryBuffer.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#pragma once

#include <react/cxxstableapi/PrivateGuard.h>

#include <optional>
#include <unordered_map>
#include <vector>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#pragma once

#include <react/cxxstableapi/PrivateGuard.h>

#include "PerformanceEntryCircularBuffer.h"
#include "PerformanceEntryKeyedBuffer.h"
#include "PerformanceEntryReporterListeners.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#pragma once

#include <react/cxxstableapi/PrivateGuard.h>

#include "PerformanceEntry.h"

#include <folly/dynamic.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#pragma once

#include <react/cxxstableapi/PrivateGuard.h>

#include "PerformanceEntryBuffer.h"
#include "PerformanceObserverRegistry.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#pragma once

#include <react/cxxstableapi/PrivateGuard.h>

#include <memory>
#include <mutex>
#include <set>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Pod::Spec.new do |s|

resolve_use_frameworks(s, header_mappings_dir: "../../..", module_name: "React_performancetimeline")

s.dependency "React-cxxstableapi"

s.dependency "React-featureflags"
add_dependency(s, "React-jsinspector", :framework_name => 'jsinspector_modern')
add_dependency(s, "React-jsinspectortracing", :framework_name => 'jsinspector_moderntracing')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#include <ReactCommon/RuntimeExecutor.h>
#include <jsi/hermes-interfaces.h>
#include <react/performance/timeline/PerformanceEntryReporter.h>
#include <react/renderer/consistency/ShadowTreeRevisionConsistencyManager.h>
#include <react/renderer/runtimescheduler/SchedulerPriorityUtils.h>
#include <react/renderer/runtimescheduler/Task.h>
Expand All @@ -20,6 +19,8 @@

namespace facebook::react {

class PerformanceEntryReporter;

using RuntimeSchedulerRenderingUpdate = std::function<void()>;
using SurfaceId = int32_t;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <cxxreact/TraceSection.h>
#include <jsinspector-modern/tracing/EventLoopReporter.h>
#include <react/featureflags/ReactNativeFeatureFlags.h>
#include <react/performance/timeline/PerformanceEntryReporter.h>
#include <react/renderer/consistency/ScopedShadowTreeRevisionLock.h>
#include <react/timing/primitives.h>
#include <react/utils/OnScopeExit.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@
#include <cxxreact/TraceSection.h>
#include <react/debug/react_native_assert.h>
#include <react/featureflags/ReactNativeFeatureFlags.h>
#include <react/performance/cdpmetrics/CdpMetricsReporter.h>
#include <react/performance/cdpmetrics/CdpPerfIssuesReporter.h>
#include <react/performance/timeline/PerformanceEntryReporter.h>
#include <react/renderer/animationbackend/AnimationBackend.h>
#include <react/renderer/componentregistry/ComponentDescriptorRegistry.h>
#include <react/renderer/core/EventQueueProcessor.h>
#include <react/renderer/core/LayoutContext.h>
#include <react/renderer/mounting/MountingOverrideDelegate.h>
#include <react/renderer/mounting/ShadowViewMutation.h>
#include <react/renderer/observers/events/EventPerformanceLogger.h>
#include <react/renderer/runtimescheduler/RuntimeScheduler.h>
#include <react/renderer/uimanager/LayoutEventEmitter.h>
#include <react/renderer/uimanager/UIManager.h>
Expand All @@ -44,12 +48,14 @@ Scheduler::Scheduler(

if (ReactNativeFeatureFlags::enableBridgelessArchitecture() &&
ReactNativeFeatureFlags::cdpInteractionMetricsEnabled()) {
cdpMetricsReporter_.emplace(CdpMetricsReporter{runtimeExecutor_});
cdpMetricsReporter_ =
std::make_unique<CdpMetricsReporter>(runtimeExecutor_);
performanceEntryReporter_->addEventListener(&*cdpMetricsReporter_);
}

if (ReactNativeFeatureFlags::perfIssuesEnabled()) {
cdpPerfIssuesReporter_.emplace(CdpPerfIssuesReporter{runtimeExecutor_});
cdpPerfIssuesReporter_ =
std::make_unique<CdpPerfIssuesReporter>(runtimeExecutor_);
performanceEntryReporter_->addEventListener(&*cdpPerfIssuesReporter_);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,12 @@
#include <vector>

#include <ReactCommon/RuntimeExecutor.h>
#include <react/performance/cdpmetrics/CdpMetricsReporter.h>
#include <react/performance/cdpmetrics/CdpPerfIssuesReporter.h>
#include <react/performance/timeline/PerformanceEntryReporter.h>
#include <react/renderer/componentregistry/ComponentDescriptorFactory.h>
#include <react/renderer/core/ComponentDescriptor.h>
#include <react/renderer/core/EventEmitter.h>
#include <react/renderer/core/EventListener.h>
#include <react/renderer/core/LayoutConstraints.h>
#include <react/renderer/mounting/MountingOverrideDelegate.h>
#include <react/renderer/observers/events/EventPerformanceLogger.h>
#include <react/renderer/scheduler/InspectorData.h>
#include <react/renderer/scheduler/SchedulerDelegate.h>
#include <react/renderer/scheduler/SchedulerToolbox.h>
Expand All @@ -34,6 +30,11 @@

namespace facebook::react {

class CdpMetricsReporter;
class CdpPerfIssuesReporter;
class EventPerformanceLogger;
class PerformanceEntryReporter;

/*
* Scheduler coordinates Shadow Tree updates and event flows.
*/
Expand Down Expand Up @@ -145,8 +146,8 @@ class Scheduler final : public UIManagerDelegate {
std::shared_ptr<std::optional<const EventDispatcher>> eventDispatcher_;

std::shared_ptr<PerformanceEntryReporter> performanceEntryReporter_;
std::optional<CdpMetricsReporter> cdpMetricsReporter_;
std::optional<CdpPerfIssuesReporter> cdpPerfIssuesReporter_;
std::unique_ptr<CdpMetricsReporter> cdpMetricsReporter_;
std::unique_ptr<CdpPerfIssuesReporter> cdpPerfIssuesReporter_;
std::shared_ptr<EventPerformanceLogger> eventPerformanceLogger_;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <jsi/instrumentation.h>
#include <jsinspector-modern/HostTarget.h>
#include <react/featureflags/ReactNativeFeatureFlags.h>
#include <react/performance/timeline/PerformanceEntryReporter.h>
#include <react/renderer/runtimescheduler/RuntimeSchedulerBinding.h>
#include <react/runtime/JSRuntimeBindings.h>
#include <react/timing/primitives.h>
Expand Down
Loading