# Faster rclpy executor now in Rolling

**URL:** <https://discourse.openrobotics.org/t/faster-rclpy-executor-now-in-rolling/42852>\
**Category:** ROS General\
**Tags:** ros2, rolling, python\
**Created:** [March 27, 2025, 9:51pm UTC](https://discourse.openrobotics.org/t/faster-rclpy-executor-now-in-rolling/42852 "2025-03-27T21:51:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bmartin427](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/bmartin427/32/23802_2.png) [@bmartin427](https://discourse.openrobotics.org/u/bmartin427)\
**Post date:** [March 27, 2025, 9:51pm UTC](https://discourse.openrobotics.org/t/faster-rclpy-executor-now-in-rolling/42852/1 "2025-03-27T21:51:18Z")

</div>

I’m announcing a new executor that’s now available for rclpy in Rolling, which is a port of the rclcpp EventsExecutor approach for use in Python. This was motivated by the large increase in CPU usage my company (Merlin Labs) experienced when porting an existing project from Noetic to Iron, most especially among our Python-based nodes. More background and benchmarks are available [here](https://github.com/ros2/rclpy/issues/1389), but the upshot is CPU usage has been observed to be as little as **a tenth** of that of the default SingleThreadedExecutor for some workloads!

Functionally, it should largely be a drop-in replacement substituting `rclpy.experimental.EventsExecutor` for `rclpy.executors.SingleThreadedExecutor` in your code. Being single threaded, it does functionally ignore all callback groups and treat every event as mutually exclusive in its current form. Additionally, it may start to get inefficient if you have a large number of ROS timers running in the same process.

This feature is expected to be part of the upcoming Kilted release, and there is also [an effort](https://github.com/ros2/rclpy/pull/1435) underway to backport it to Jazzy.

---

<div class="post-metadata">

**Author:** ![peci1](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/peci1/32/10145_2.png) [@peci1](https://discourse.openrobotics.org/u/peci1)\
**Post date:** [March 27, 2025, 10:16pm UTC](https://discourse.openrobotics.org/t/faster-rclpy-executor-now-in-rolling/42852/2 "2025-03-27T22:16:35Z")

</div>

Thanks million times for this work! I hope that once it’s tested and mature, it will find its way even to the beginners’ tutorials and become the default 🙂

---

<div class="post-metadata">

**Author:** ![Timple](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/timple/32/4891_2.png) [@Timple](https://discourse.openrobotics.org/u/Timple)\
**Post date:** [March 28, 2025, 6:35am UTC](https://discourse.openrobotics.org/t/faster-rclpy-executor-now-in-rolling/42852/3 "2025-03-28T06:35:43Z")

</div>

> [@bmartin427](#):
>
> Functionally, it should largely be a drop-in replacement substituting `rclpy.experimental.EventsExecutor` for `rclpy.executors.SingleThreadedExecutor` in your code.

Most of our nodes never even specified one (like most tutorials). But I guess you can just replace  
`rclpy.spin(my_node)`  
by  
`rclpy.spin(my_node, rclpy.experimental.EventsExecutor)`

---

<div class="post-metadata">

**Author:** ![charlielito](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/charlielito/32/14353_2.png) [@charlielito](https://discourse.openrobotics.org/u/charlielito)\
**Post date:** [April 8, 2025, 3:09pm UTC](https://discourse.openrobotics.org/t/faster-rclpy-executor-now-in-rolling/42852/4 "2025-04-08T15:09:26Z")

</div>

That’s awesome! Thanks for releasing this to the community!  
One question: does it support the async api?

---

<div class="post-metadata">

**Author:** ![bmartin427](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/bmartin427/32/23802_2.png) [@bmartin427](https://discourse.openrobotics.org/u/bmartin427)\
**Post date:** [April 8, 2025, 3:33pm UTC](https://discourse.openrobotics.org/t/faster-rclpy-executor-now-in-rolling/42852/5 "2025-04-08T15:33:55Z")

</div>

I believe so. I haven’t used that API extensively but there are a number of unit tests against it in rclpy that pass against EventsExecutor.
