<br><br><div class="gmail_quote">On Tue, Jun 14, 2011 at 6:26 PM, Kazu Yamamoto <span dir="ltr">&lt;<a href="mailto:kazu@iij.ad.jp">kazu@iij.ad.jp</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Hello,<br>
<div class="im"><br>
&gt; I think the reason we didn&#39;t include the header is because, when I<br>
&gt; wrote it, I didn&#39;t know of a cross-platform way to get file sizes. Now<br>
&gt; that I know about unix-compat, this seems like a reasonable thing to<br>
&gt; add. Anyone know a reason we *shouldn&#39;t* do this?<br>
<br>
</div>For high performance web servers, system calls are the bottleneck.<br>
So, Warp or its libraries should avoid unnecessary system calls.<br>
<br>
Wai applications HAVE TO call a system call (stat()) to get file<br>
information (for instance, modification time) and can get a file size<br>
at the same time. So, they can add Content-Length: with one system<br>
call.<br></blockquote><div><br></div><div>There are 2 basic kinds of WAI apps- those for serving files that might change (a file server), and those that know exactly what files exist in advance (a web application). In the case of a web application, we can get all this information just once at compile time. For a file server, we could allow a configuration parameter for whether or not to do the system call. Of course, it is possible to mix these 2 use cases in one application, but that can be handled with multiple instances of wai-app-static.</div>

<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
If Warp or its libraries add Content-Length:, they need to call as<br>
system call again. It gives really bad performance impact.<br>
<br>
So, I support the current way of Warp.<br>
<font color="#888888"><br>
--Kazu<br>
</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
web-devel mailing list<br>
<a href="mailto:web-devel@haskell.org">web-devel@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/web-devel" target="_blank">http://www.haskell.org/mailman/listinfo/web-devel</a><br>
</div></div></blockquote></div><br>