<div class="gmail_quote">Hi Aran,</div><div class="gmail_quote"><br></div><div class="gmail_quote">On Fri, Apr 30, 2010 at 9:28 PM, Aran Donohue <span dir="ltr"><<a href="mailto:aran.donohue@gmail.com">aran.donohue@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Thanks for the excellent links, that's exactly what I wanted. It's interesting that they've chosen not to base the new work on libevent. </blockquote>
<div><br></div><div>The reason was mostly performance concerns due to libev(ent) using callbacks to signal events. Callbacks from C into Haskell can be inefficient. From the FFI addendum:</div><div><br></div>"Optionally, an import declaration can specify, after the calling convention, the safety level that should be used when invoking an external entity. A safe call is less efficient, but guarantees to leave the Haskell system in a state that allows callbacks from the external code."</div>
<div class="gmail_quote"><br></div><div class="gmail_quote">Another reason was that if the code is in Haskell we can more easily get people to hack on it and adapt it to our needs.</div><div class="gmail_quote"><br></div>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div>As an aside, I really don't think that the case study should be given any more linkjuice as a response to GHC/Haskell IO concurrency questions. While it's a wonderful tutorial on the programming technique side, it's a decade old and was written at a time when serving 4000 requests was a reasonable benchmark. These days modern web servers are moving more and more toward handling tens of thousands of concurrent held-open <i>connections</i>---a different metric and a different scale.</div>
</blockquote><div><br></div><div>The event library, linked by Don, handles tens of thousands of idle connections without problems (see the idle connection generator [1] I created). Bryan wrote a simple HTTP server [2] that handles 20,000 requests per second on one core.</div>
<div><br></div>1. <a href="http://github.com/tibbe/event/blob/master/benchmarks/DeadConn.hs">http://github.com/tibbe/event/blob/master/benchmarks/DeadConn.hs</a><br>2. <a href="http://github.com/tibbe/event/blob/master/benchmarks/StaticHttp.hs">http://github.com/tibbe/event/blob/master/benchmarks/StaticHttp.hs</a><br>
<div><br></div><div>Cheers,</div><div>Johan</div><div><br></div></div>