Thanks for the great analysis. I've updated pmon.py (r10575), as I agree that that loop can run slower.  What was the CPU usage before that?<br><br>You previously mentioned getting some numbers on rospy -- I'd love to know if you see any issues there or not, even if you don't have time to track down more fast loops. AFAIK, the main problem with rospy is that Python gobbles up memory when you use threads, and rospy is a bit too greedy in this regard. The hope is to redo the threading model in a future rewrite, but it's good to understand the current issues when prioritizing.<br>

<br>thanks<br>Ken<br><br><div class="gmail_quote">On Sat, Jul 31, 2010 at 11:28 AM, Cedric Pradalier <span dir="ltr"><<a href="mailto:cedric.pradalier@mavt.ethz.ch">cedric.pradalier@mavt.ethz.ch</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">


  
  

<div text="#000000" bgcolor="#ffffff"><div class="im">
On 07/31/10 13:11, Cedric Pradalier wrote:
<blockquote type="cite">
  
  <br>
To continue on my fight against overhead, I've had good performance
improvement of rosout by replacing all the timeout argument in the
CallbackQueue::callAvailable and CallbackQueue::callOne from 0.01s to
0.1s. <br>
Now my rosout is really sitting in a corner doing nothing while I'm not
logging.<br>
  <br>
Can you foresee any drawbacks from this change?<br>
</blockquote>
<br></div>
And the final touch to make roscore behave: in package roslaunch, file
src/roslaunch/pmon.py:570<br>
replacing time.sleep(0.01) with time.sleep(0.1) makes roscore use less
than 1% cpu, and AFAICS just slows down a little the process respawn
mechanism.<br>
<br>
I don't think I will optimise farther for now. In summary, applying all
the changes in this thread brings my set of core processes (roscore,
rosmaster, rosout, some serial data gatherer/publisher) from a total of
20% cpu load, to 5-6%, without any noticeable performance loss so far.<br>
<br>
HTH<div class="im"><br>
<br>
<pre cols="80">-- 
Dr. Cedric Pradalier
<a href="http://www.asl.ethz.ch/people/cedricp" target="_blank">http://www.asl.ethz.ch/people/cedricp</a>
</pre>
</div></div>

<br>_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org">ros-users@code.ros.org</a><br>
<a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
<br></blockquote></div><br>