Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

rospy horrible performance with sim_time

It is widely known that python isn't the best language when it comes to performance. But I've detected that mixing rospy and a simulation environment leads to awful performance.

Here's a quick example, run the following commands with and without gazebo running (or switching /use_sim_time from false to true while the simulator is running):

roscd rospy_tutorials/001_talker_listener/ ./

If you run a tool like top, you'll see that this listener node (which is doing nothing but waiting for the /chatter topic) is taking up around 10% of cpu time, depending on your computer. But with /use_sim_time = false it uses 0% cpu.

Things get worse if you start an ActionServer, cpu usage with sim time is 15% and cpu usage without it is still 0%.

My guess is that it is because of listening to the /time topic, but it still seems to be that this performance is unacceptable for an application that is doing nothing.

Is there any way to improve this situation? Are there any plans for the future?