Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Johannes Waldmann <waldmann <at> imn.htwk-leipzig.de>
Subject: Text.PrettyPrint.HughesPJ is sloooow (and wl-pprint-text is fast)
Newsgroups: gmane.comp.lang.haskell.cafe
Date: Monday 4th February 2013 13:36:53 UTC (over 4 years ago)
I was running into serious performance problems when printing moderately
sized
Doc and Xml data (HaXml goes via Doc).

So I replace Text.PrettyPrint.HughesPJ with Text.PrettyPrint.Leijen.Text,
and patched the HaXml printer in the same way. Now it is running much
faster.

This confirms some of the comments here:
http://stackoverflow.com/questions/9761507/which-pretty-print-library

If you want to see for yourself, here is a test case.
It constructs and prints a document tree with about 10^4 nodes,
rendered to an Xml document with 10^6 (nonblank) chars:
https://github.com/jwaldmann/haskell-tpdb/blob/master/test/speed.hs

Of the 4 output methods (fin the main program), only one takes < 1 second.
Rendering via HughesPJ needs extra stack (!) and takes about 20 seconds.
Rendering via Text.XML.HaXml.ByteStringPP seems much slower still (!)

(ghc-7.6.2, pretty-1.1.1.0, HaXml-1.23.3, wl-pprint-text-1.1.0.0,
amd64, fedora 18, kernel 3.7.4)
 
CD: 3ms