CPU usage
#140
Replies: 1 comment 2 replies
-
It is not immediately apparent where the CPU time is consumed, but I have some questions. Did you try any code profiling? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I built this in release and started several instances of the turtlebot node to see if they could communicate with each other over localhost and it worked, the keyboard input into one node while that terminal is in focus is received by the read back subscribers on all the other instances- I'll try this out with multiple computers on the same network later. (It's especially nice because I don't have any C++/python ros2 packages and dependencies installed on this system, having a lightweight rust-only ability to make ros nodes that communicate with regular ros2 is fantastic, though now I want to make a rust ros2 topic list and some other basic tools...)
One thing I notice is that each node takes ~5% cpu according to top, and this cpu usage goes up a little with each instance I start, and doubles while I'm pressing keys repeatedly. They aren't exact matches but the ros1 turtlebot_teleop_joy and turtlebot_teleop_key python and C++ nodes in ros1 take ~1.0% cpu to accomplish transmit and receive of the similar messages (I had to reduce the
joy
update raterosrun joy joy_node _coalesce_interval:=0.03
, the default value is 0.001 and moving the gamepad a lot does start to eat cpu, and neither of those nodes is doing the readback like this rustdds one is).I know this keyboard input node wasn't made with speed tests in mind, but what's the general feeling for where the cpu is being taken up, could the use of mio and polling be tuned up (I'm not familiar with it), or being compliant with dds is inherently going to consume so much more cpu- and the better route for me if I want to save cpu are IPC or any of the methods I've seen mentioned elsewhere that avoid some or all of dds while still preserving some interoperability with other ros2 nodes?
Beta Was this translation helpful? Give feedback.
All reactions