There is no way enet can use 20% cpu if used properly on a PC from the last 5 years.  This is something in your usage pattern.  std::vector&#39;s overhead is multiple orders of magnitude too small to bubble up this large.  Blocking sockets, or excessive polling could both cause this.  Also, check your bandwidth usage.  If you&#39;re streaming megabits through enet, that might explain it.<br>
<br><div class="gmail_quote">On Sun, Feb 7, 2010 at 2:30 PM, Blair Holloway <span dir="ltr">&lt;<a href="mailto:thynameisblair@chaosandcode.com">thynameisblair@chaosandcode.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="gmail_quote"><div class="im">On Fri, Feb 5, 2010 at 7:14 PM, Syed Setia Pernama <span dir="ltr">&lt;<a href="mailto:syedhs@yahoo.com" target="_blank">syedhs@yahoo.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div><div style="font-family:verdana,helvetica,sans-serif;font-size:10pt">I am using Intel VTune profiler and the hits ~20% was in the function enet_protocol_dispatch_incoming_commands.<br><div>I think the reason why enet is taking much of the processing time because first<br>


</div></div></div></blockquote><div><br></div></div><div>To get the obvious out of the way: are your sockets set to non-blocking? If they aren&#39;t, try that first and see if performance improves.</div><div><br></div><div>
Since most of your time appears to be spent receiving, having each client connected to a separate Enet host, and processing that host in a separate thread, seems beneficial.</div>

<div><br></div><div>Since every Enet host will want to listen to a separate socket, will you be setting aside a separate Enet host for clients to connect to, that will tell the clients the port number of the actual host they should connect to? Or do you have some other method of &#39;jumping&#39; the clients over to a new host?</div>

<div><br></div><font color="#888888"><div>- Blair</div></font></div>
<br>_______________________________________________<br>
ENet-discuss mailing list<br>
<a href="mailto:ENet-discuss@cubik.org">ENet-discuss@cubik.org</a><br>
<a href="http://lists.cubik.org/mailman/listinfo/enet-discuss" target="_blank">http://lists.cubik.org/mailman/listinfo/enet-discuss</a><br>
<br></blockquote></div><br>