
On 2008 Aug 13, at 15:04, Brandon S. Allbery KF8NH wrote:
On 2008 Aug 13, at 15:01, Chaddaï Fouché wrote:
2008/8/13 Jason Dusek
: I found an old lib for it:
http://www.haskell.org/ghc/docs/6.0/html/unix/System.Sendfile.html
Hoogle turns up nothing, though.
That don't sound very useful... Maybe when we only had String it was much more performant for big transfert, but now we can recode this in one short line of ByteString code and get the same performance as C.
sendfile() is actually a system call, not a library function.
I should clarify: what sendfile() is supposed to optimize isn't writing large strings, or even the user<->kernel roundtrips; it's an optimization to the kernel network stack (network buffer management, to be specific). Web servers use it to serve static content (e.g. icons, images, stylesheets) because it significantly reduces system load. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH