Skip to content

Performance regression in EventsExecutor on jazzy #2799

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jplapp opened this issue Apr 10, 2025 · 9 comments
Closed

Performance regression in EventsExecutor on jazzy #2799

jplapp opened this issue Apr 10, 2025 · 9 comments
Labels
bug Something isn't working

Comments

@jplapp
Copy link

jplapp commented Apr 10, 2025

Operating System:

ubuntu 22

ROS version or commit hash:

jazzy

RMW implementation (if applicable):

rmw_cyclonedds_cpp and rmw_fastdds_cpp

RMW Configuration (if applicable):

No response

Client library (if applicable):

rclcpp

'ros2 doctor --report' output

No response

Steps to reproduce issue

  1. Run any action server with EventsExecutor, e.g. from ros2 demos , compile with EventsExecutor specified rclcpp_components_register_node(action_tutorials PLUGIN "action_tutorials_cpp::FibonacciActionServer" EXECUTABLE fibonacci_action_server EXECUTOR EventsExecutor)
  2. ros2 run action_tutorials_cpp fibonacci_action_server
  3. Check CPU load

Expected behavior

EventsExecutor has similar or less CPU load than SingleThreadedExecutor when running an idle action server

Running with SingleThreadedExecutor the CPU load is 0% (as nothing is happening)

Actual behavior

CPU load is significantly more than 0, e.g. 50%:

Image

Additional information

When I revert #2674 , it behaves as expected

@jplapp jplapp added the bug Something isn't working label Apr 10, 2025
@MCFurry
Copy link

MCFurry commented Apr 10, 2025

Ahh! We justed started a deep-dive and came to the same conclusion...

@ros-discourse
Copy link

This issue has been mentioned on ROS Discourse. There might be relevant details there:

https://discourse.ros.org/t/new-packages-and-patch-release-4-for-jazzy-jalisco-2025-04-07/43100/3

@mjcarroll
Copy link
Member

@jmachowinski and @alsora FYI.

@jmachowinski
Copy link
Collaborator

I'll have a look

@jmachowinski
Copy link
Collaborator

@MCFurry @jplapp
Please check an verify that #2800 fixes the bug for you.

@MCFurry
Copy link

MCFurry commented Apr 10, 2025

@jmachowinski I just ran a very quick test from your branch, but unfortunately the issue is still there... Thanks for the quick effort though!

@jmachowinski
Copy link
Collaborator

jmachowinski commented Apr 10, 2025

@jmachowinski I just ran a very quick test from your branch, but unfortunately the issue is still there... Thanks for the quick effort though!

How exactly did you test ? I checked with the procedure described in the first post, and the issue is solved for me using the patch. I just rechecked it on a second PC.

diff --git a/action_tutorials/action_tutorials_cpp/CMakeLists.txt b/action_tutorials/action_tutorials_cpp/CMakeLists.txt
index 56fa718..d3b1ea9 100644
--- a/action_tutorials/action_tutorials_cpp/CMakeLists.txt
+++ b/action_tutorials/action_tutorials_cpp/CMakeLists.txt
@@ -29,7 +29,7 @@ add_library(action_tutorials SHARED
   src/fibonacci_action_client.cpp
   src/fibonacci_action_server.cpp)
 rclcpp_components_register_node(action_tutorials PLUGIN "action_tutorials_cpp::FibonacciActionClient" EXECUTABLE fibonacci_action_client)
-rclcpp_components_register_node(action_tutorials PLUGIN "action_tutorials_cpp::FibonacciActionServer" EXECUTABLE fibonacci_action_server)
+rclcpp_components_register_node(action_tutorials PLUGIN "action_tutorials_cpp::FibonacciActionServer" EXECUTABLE fibonacci_action_server  EXECUTOR EventsExecutor)
 target_compile_definitions(action_tutorials
   PRIVATE "ACTION_TUTORIALS_CPP_BUILDING_DLL")
 ament_target_dependencies(action_tutorials

Without patch

Image

With patch

Image

@jplapp
Copy link
Author

jplapp commented Apr 10, 2025

From my side I can verify that the issue is resolved, both in the test case as well as the full system.

@jmachowinski thanks for the quick fix!

@jplapp jplapp closed this as completed Apr 10, 2025
@MCFurry
Copy link

MCFurry commented Apr 10, 2025

Hmm my bad, it seems during my test only rclcpp was build from source but rclcpp_action was not. Now testing again and the issue indeed seems solved. Thanks again for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants