<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">&lt;<a href="mailto:aran.donohue@gmail.com">aran.donohue@gmail.com</a>&gt;</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&#39;s exactly what I wanted. It&#39;s interesting that they&#39;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>&quot;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.&quot;</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&#39;t think that the case study should be given any more linkjuice as a response to GHC/Haskell IO concurrency questions. While it&#39;s a wonderful tutorial on the programming technique side, it&#39;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>