[web-devel] gitit performance: happstack vs yesod

John MacFarlane jgm at berkeley.edu
Sat Jul 7 04:50:22 CEST 2012


I've been working on a port of gitit to Yesod, which is currently called
gitit2 (https://github.com/jgm/gitit2). At this point I have implemented
most of the basic wiki functionality.

I've really been enjoying some of Yesod's features -- especially the
type-safe URLs, form support, internationalization, and widgets -- and
the code is much cleaner and shorter than the original gitit code.
But today I thought I'd look at performance, and I was surprised to
find that gitit2 is considerably slower than the original gitit (built
on happstack). For example, on one simple test page, siege recorded 9
transactions per second for gitit2, 18 for the original gitit. (This is
with caching turned off, so each hit involves getting content from the
git repository, parsing it, and creating an HTML wiki page. Of course
most of that work is done by filestore and pandoc, which are used
by both gitit and gitit2.)

I'm really curious why gitit2 is so much slower, and I wonder whether
I'm making some basic mistake. At this point most of the code is in one
module, https://github.com/jgm/gitit2/blob/master/Network/Gitit2.hs .
This defines a Yesod subsite which is wrapped by a Yesod site in the
main executable, https://github.com/jgm/gitit2/blob/master/src/gitit2.hs
. The benchmark I did just involved fetching the front page, so most
of the handlers are irrelevant. If anyone has any useful ideas, I'd be
grateful.

John




More information about the web-devel mailing list