
Two questions:
1) what version of enumerator are you building against? Version
0.4.7 fixed a problem with (>>=) which might affect you.
2) what does the profiler say? It would be helpful to build
enumerator with "-auto-all".
G
On Mon, Feb 21, 2011 at 6:19 PM, Bardur Arantsson
On 2011-02-20 12:08, Michael Snoyman wrote:
On Sun, Feb 20, 2011 at 12:00 PM, Bardur Arantsson
wrote: On 2011-02-20 10:29, Michael Snoyman wrote:
On Sun, Feb 20, 2011 at 11:04 AM, Bardur Arantsson
wrote: [--snip--]
It's entirely possible that WAI/enumerators/builder/Warp is adding some overhead. But what exactly are you comparing against? Warp is *definitely* doing some extra stuff that a simple Data.ByteString.hPut is not, such as timeout handling. I'd be interested in any numbers that you come up with from profiling, please do share.
Silly of me, I should have explained properly: I'm comparing against a simple monadic HTTP server using the "HTTP" module for parsing/rendering requests and response headers (so regular Strings) and simple (strict) bytestring output in the IO monad. Socket operations were handled using the network/network-bytestring packages.
While I can readily accept a little extra overhead from a more elegant model like WAI/Warp, I don't think 5-10% CPU usage is reasonable for streaming data to a *single* client on a reasonably beefy 2.4GHz Core2 CPU.
Given the Warp benchmarks that have been posted and the fact that my (admittedly slightly simpler) http server uses around 0-1% CPU, that makes me think that I'm probably doing something wrong.
Anyway, I'll see about producing some proper benchmarks (probably not until the weekend, though) and I guess I/we can take it from there.
Cheers,
_______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel
--
Gregory Collins