<div class="gmail_quote">On 18 July 2012 10:39, Matthias Radestock <span dir="ltr"><<a href="mailto:matthias@rabbitmq.com" target="_blank">matthias@rabbitmq.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Take a look at rabbit_reader.erl, in particular the recvloop and mainloop, and rabbit_net.erl.<br></blockquote><div><br>It looks like you could summarise the improvements as: instead of requesting an exact number of bytes in the reader loop, and waiting for that exact number to be delivered, when you need more input you set active_once, which feeds you whatever's available. You take what's given, and if it's (more than) enough, consume it up until it is no longer sufficient, at which point you set active_once again.<br>
<br>Even shorter: the new code avoids use of async_recv and instead sets
active_once when it wants more input, until it has enough to work with.<br>
<br>
Is that right?<br><br>Can you say anything about how much better things are this way? E.g. some percentage improvement to throughput, presumably?<br><br>Regards,<br> Tony<br></div></div>-- <br>Tony Garnock-Jones<br><a href="mailto:tonygarnockjones@gmail.com" target="_blank">tonygarnockjones@gmail.com</a><br>
<a href="http://homepages.kcbbs.gen.nz/tonyg/" target="_blank">http://homepages.kcbbs.gen.nz/tonyg/</a><br>