[Haskell-cafe] How to speedup generically parsing sum types?

Bas van Dijk v.dijk.bas at gmail.com
Thu Nov 3 13:27:37 CET 2011


2011/11/3 José Pedro Magalhães <jpm at cs.uu.nl>:
> - Compile with -O2 and -fno-spec-constr-count (this last one is particularly
> important)

I already compiled with -O2. Adding -fno-spec-constr-count does not
change the results.

> - Add {-# INLINE [1] #-} pragmas to the to/from methods of your Generic
> instances.

I tried:

BigSum/toJSON/generic goes from 70 ns to 52 ns! So inlining 'from' is
an improvement.

Unfortunately BigSum/fromJSON/generic stays at 13 us.

Bas



More information about the Haskell-Cafe mailing list