[web-devel] Content-Length on sendFile

Max Cantor mxcantor at gmail.com
Wed Jun 15 03:58:31 CEST 2011


I think thats a very good point.  Based on this, I'd agree that perhaps we shouldn't change sendFile.  But, I still support a note in the haddocks and possibly adding a second function as in my previous post.

max

On Jun 15, 2011, at 9:26 AM, Kazu Yamamoto (山本和彦) wrote:

> Hello,
> 
>> I think the reason we didn't include the header is because, when I
>> wrote it, I didn't know of a cross-platform way to get file sizes. Now
>> that I know about unix-compat, this seems like a reasonable thing to
>> add. Anyone know a reason we *shouldn't* do this?
> 
> For high performance web servers, system calls are the bottleneck.
> So, Warp or its libraries should avoid unnecessary system calls.
> 
> Wai applications HAVE TO call a system call (stat()) to get file
> information (for instance, modification time) and can get a file size
> at the same time. So, they can add Content-Length: with one system
> call.
> 
> If Warp or its libraries add Content-Length:, they need to call as
> system call again. It gives really bad performance impact.
> 
> So, I support the current way of Warp.
> 
> --Kazu
> 
> _______________________________________________
> web-devel mailing list
> web-devel at haskell.org
> http://www.haskell.org/mailman/listinfo/web-devel




More information about the web-devel mailing list