04:07:57 <zzing_> What is the quickest way to turn a serveDirectory into a handler for the http server?
06:46:17 <donri> ignoring the messy documentation and awkward names, the internals of happstack-server / serverpart are kind of fun
17:53:03 <donri> zzing: serveDirectory already is a handler
17:53:19 <donri> notice that it produces an "m Response"
18:46:57 <zzing_> donri, it didn't seem to work when I tried it
18:53:22 <donri> zzing_: note that it "mounts" the directory at the root of the routed path; use "dir" if you want to control that
18:53:42 <zzing_> it is quite fine to do that let me find my code to find the error of mine
18:54:30 <zzing_> simpleHTTPWithSocket socket nullConf $ serveDirectory [ "index.html" ] "/var/www"
18:55:51 <zzing_> missed a parameter
18:55:55 <zzing_> but not quite right yet
18:56:19 <zzing_>      simpleHTTPWithSocket socket nullConf $ serveDirectory EnableBrowsing [ "index.html" ] "/var/www"
18:56:23 <zzing_> Fresh eyes works :-)
18:56:24 <zzing_> merci
18:56:34 <donri> works now?
18:59:53 <zzing_> Compiled
19:00:01 <zzing_> Now I can compare snap to happstack for a trivial example
19:00:27 <donri> yay!
19:00:55 <zzing_> Right now I am doing a ms/req comparison of the most basic static serving
19:01:09 <zzing_> snap was 0.4 ms/req, apache is 0.1 ms/req
19:02:03 <donri> happstack is probably better than snap at serving files (due to using sendfile) although snap will likely be better at serving dynamic content (snap the server; heist is slow)
19:02:26 <zzing_> snap uses sendfile
19:02:36 <donri> oh?
19:02:48 <zzing_> I used it when i was serving images from my app
19:03:02 <donri> but does it use the system call?
19:03:08 <zzing_> I believe it said so
19:03:23 <zzing_> I had put together a test app that put markdown through pandoc and into a heist template
19:03:30 <zzing_> It did about 40ms/req
19:03:58 <zzing_> I used snaplets
19:04:24 <zzing_> I want to put together a similar system from the ground up to figure exactly how it works because I am not complete on my monadic understanding
19:04:46 <zzing_> Why do you think snap would be better at serving dynamic content?
19:05:39 <donri> because it uses enumerators and happstack currently uses hand-written lazy IO
19:06:10 <zzing_> Now what about heist is slow?
19:06:21 <donri> happstack actually performs quite well considering, similar to snap in most cases, but snap might win in some special cases
19:07:06 <donri> heist is slow "by design" as it's running xml transformations at rendering-time
19:07:50 <zzing_> I rather like how you get the xhtml and output more at runtime
19:08:06 <donri> what do you mean?
19:09:03 <zzing_> Well in my splice, I recieve the whole tag and can process it, and output new xhtml using the xmlhtml library
19:09:12 <zzing_> and my templates can remain on disk
19:10:45 <zzing_> I intend on doing some caching somewhere, not sure if I will just use varnish or just write my own cacher
19:10:56 <donri> you can use heist with happstack btw
19:11:11 <donri> personally i like hsx
19:11:45 <zzing_> Our benchmark is having a lot of trouble with this happstack server
19:11:50 <zzing_> Something is causing it to take a long long time
19:12:07 <zzing_> "After 4,000 requests, socrsci was taking 100ms/req"
19:12:16 <zzing_> Something really fishy is going on here
19:13:29 <zzing_> Although in a single browser request it seems to make no difference
19:13:35 <donri> hm yea i think i've heard of such behavior before
19:13:40 <donri> not sure if someone had a fix / explanation
19:13:44 <donri> stepcut?
19:14:16 <donri> zzing_: what are you compiling with btw?
19:14:22 <zzing_> ghc
19:14:25 <donri> -threaded?
19:14:28 <zzing_> no
19:15:09 <donri> might help, plus -rtsopts -with-rtsopts=-N
19:16:25 <zzing_> on the single browser it takes about 40ms more on the time graph :-) but that doesn't mean that the benchmark will be worse
19:17:13 <zzing_> The time for it spending waiting is the thing that really delays everything
19:17:30 <donri> bbl dinner
19:18:18 <zzing_> ok
19:35:14 <zzing_> Is there any reason for freebsd to be slower?
21:08:02 <donri> maybe no sendfile on bsd?