From 5b5ece79802aeabeb7536d00daa41179f781944e Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Mon, 16 Aug 2021 04:33:15 -0700 Subject: [PATCH] Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 --- .../react/renderer/core/EventDispatcher.cpp | 43 ++++++------------- .../react/renderer/core/EventDispatcher.h | 5 +-- .../react/renderer/scheduler/Scheduler.cpp | 11 +---- 3 files changed, 14 insertions(+), 45 deletions(-) diff --git a/ReactCommon/react/renderer/core/EventDispatcher.cpp b/ReactCommon/react/renderer/core/EventDispatcher.cpp index 849ac218fd9..3cfe35f3e0c 100644 --- a/ReactCommon/react/renderer/core/EventDispatcher.cpp +++ b/ReactCommon/react/renderer/core/EventDispatcher.cpp @@ -20,8 +20,7 @@ EventDispatcher::EventDispatcher( EventQueueProcessor eventProcessor, EventBeat::Factory const &synchonousEventBeatFactory, EventBeat::Factory const &asynchonousEventBeatFactory, - EventBeat::SharedOwnerBox const &ownerBox, - bool unbatchedQueuesOnly) + EventBeat::SharedOwnerBox const &ownerBox) : synchronousUnbatchedQueue_(std::make_unique( eventProcessor, synchonousEventBeatFactory(ownerBox))), @@ -33,8 +32,7 @@ EventDispatcher::EventDispatcher( asynchonousEventBeatFactory(ownerBox))), asynchronousBatchedQueue_(std::make_unique( eventProcessor, - asynchonousEventBeatFactory(ownerBox))), - unbatchedQueuesOnly_(unbatchedQueuesOnly) {} + asynchonousEventBeatFactory(ownerBox))) {} void EventDispatcher::dispatchEvent(RawEvent &&rawEvent, EventPriority priority) const { @@ -48,36 +46,19 @@ void EventDispatcher::dispatchStateUpdate( } void EventDispatcher::dispatchUniqueEvent(RawEvent &&rawEvent) const { - if (unbatchedQueuesOnly_) { - asynchronousUnbatchedQueue_->enqueueUniqueEvent(std::move(rawEvent)); - } else { - asynchronousBatchedQueue_->enqueueUniqueEvent(std::move(rawEvent)); - } + asynchronousBatchedQueue_->enqueueUniqueEvent(std::move(rawEvent)); } const EventQueue &EventDispatcher::getEventQueue(EventPriority priority) const { - if (unbatchedQueuesOnly_) { - switch (priority) { - case EventPriority::SynchronousUnbatched: - return *synchronousUnbatchedQueue_; - case EventPriority::SynchronousBatched: - return *synchronousUnbatchedQueue_; - case EventPriority::AsynchronousUnbatched: - return *asynchronousUnbatchedQueue_; - case EventPriority::AsynchronousBatched: - return *asynchronousUnbatchedQueue_; - } - } else { - switch (priority) { - case EventPriority::SynchronousUnbatched: - return *synchronousUnbatchedQueue_; - case EventPriority::SynchronousBatched: - return *synchronousBatchedQueue_; - case EventPriority::AsynchronousUnbatched: - return *asynchronousUnbatchedQueue_; - case EventPriority::AsynchronousBatched: - return *asynchronousBatchedQueue_; - } + switch (priority) { + case EventPriority::SynchronousUnbatched: + return *synchronousUnbatchedQueue_; + case EventPriority::SynchronousBatched: + return *synchronousBatchedQueue_; + case EventPriority::AsynchronousUnbatched: + return *asynchronousUnbatchedQueue_; + case EventPriority::AsynchronousBatched: + return *asynchronousBatchedQueue_; } } diff --git a/ReactCommon/react/renderer/core/EventDispatcher.h b/ReactCommon/react/renderer/core/EventDispatcher.h index c8582016849..f81ccd7cc26 100644 --- a/ReactCommon/react/renderer/core/EventDispatcher.h +++ b/ReactCommon/react/renderer/core/EventDispatcher.h @@ -32,8 +32,7 @@ class EventDispatcher { EventQueueProcessor eventProcessor, EventBeat::Factory const &synchonousEventBeatFactory, EventBeat::Factory const &asynchonousEventBeatFactory, - EventBeat::SharedOwnerBox const &ownerBox, - bool unbatchedQueuesOnly); + EventBeat::SharedOwnerBox const &ownerBox); /* * Dispatches a raw event with given priority using event-delivery pipe. @@ -60,8 +59,6 @@ class EventDispatcher { std::unique_ptr synchronousBatchedQueue_; std::unique_ptr asynchronousUnbatchedQueue_; std::unique_ptr asynchronousBatchedQueue_; - - bool const unbatchedQueuesOnly_; }; } // namespace react diff --git a/ReactCommon/react/renderer/scheduler/Scheduler.cpp b/ReactCommon/react/renderer/scheduler/Scheduler.cpp index 96ad3d699db..2d5e153505a 100644 --- a/ReactCommon/react/renderer/scheduler/Scheduler.cpp +++ b/ReactCommon/react/renderer/scheduler/Scheduler.cpp @@ -69,22 +69,13 @@ Scheduler::Scheduler( uiManager->updateState(stateUpdate); }; -#ifdef ANDROID - auto unbatchedQueuesOnly = - reactNativeConfig_->getBool("react_fabric:unbatched_queues_only_android"); -#else - auto unbatchedQueuesOnly = - reactNativeConfig_->getBool("react_fabric:unbatched_queues_only_ios"); -#endif - // Creating an `EventDispatcher` instance inside the already allocated // container (inside the optional). eventDispatcher_->emplace( EventQueueProcessor(eventPipe, statePipe), schedulerToolbox.synchronousEventBeatFactory, schedulerToolbox.asynchronousEventBeatFactory, - eventOwnerBox, - unbatchedQueuesOnly); + eventOwnerBox); // Casting to `std::shared_ptr`. auto eventDispatcher =