[Haskell-cafe] Lack of inlining -> slow parsing with Data.Binary

Don Stewart dons at galois.com
Tue Jan 6 14:32:31 EST 2009

> Hi,
> I'm parsing Java classfiles with Data.Binary, the code is here:
> http://paste.org/index.php?id=4625
> The problem is that the resulting code parses rt.jar from JDK6 (about
> 15K classes, 47Mb zipped) in 15 seconds (run the program with main
> -mclose rt.jar, for instance), which is 10 times slower than my Java
> version of the same code.
> I compile the program with -O2 ; I tried -ddump-inlinings and it turns
> out that my readByte/readWord16/readWord32 functions don't get
> inlined, despite being simply aliases for 'get::Get WordXX'; so, in
> places where my Java version does a pointer access (after being
> JIT-compiled), the Haskell version does two function calls.
> What can be the reason of this lack of inlining? Or how do I
> understand the output of -ddump-inlinings?

Which version of GHC and Data.Binary are you using? 
If using 6.8.x, use the previous Data.Binary release. If using 6.10.x,
use the latest.

-- Don

More information about the Haskell-Cafe mailing list