[Haskell-cafe] Optimizing Parsec 3 -- was: Wiki software?

Paulo Tanimoto tanimoto at arizona.edu
Mon Nov 30 23:26:08 EST 2009


On Mon, Nov 23, 2009 at 12:29 PM, Antoine Latter <aslatter at gmail.com> wrote:
> On Sun, Nov 22, 2009 at 11:56 AM, Antoine Latter <aslatter at gmail.com> wrote:
>> Running 'pandoc --strict' over the Markdown readme.text takes:
>> ~0.09s with pandoc built against parsec-2
>> ~0.19s with pandoc built against parsec-3
>> on my machine.
>> I have a branch of parsec-3 which seems to brings us back to parsec-2
>> numbers, but also fails the rst-reader test-case in the pandoc testing
>> suite:
>> http://community.haskell.org/~aslatter/code/parsec/cps
> In reply to my own post, the branch of parsec posted now passes all of
> the pandoc test cases.
> If there are any other consumers of the parsec library that have tests
> I can run let me know.
> The 'many' combinator is one of those things that can look right, be
> wrong, yet work for almost everything.

I finally had some time to test it.  After running it multiple times
(of course, it would be nice to use criterion here), I'm getting
numbers in this neighborhood:

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version

$ time pandoc --strict README > /dev/null

parsec 2:
real	0m0.140s
user	0m0.130s
sys	0m0.010s

parsec 3 - antoine's:
real	0m0.151s
user	0m0.150s
sys	0m0.010s

parsec 3 - hackage:
real	0m0.243s
user	0m0.240s
sys	0m0.010s

Nice work, Antoine!


More information about the Haskell-Cafe mailing list