[Haskell-cafe] Lack of inlining -> slow parsing with Data.Binary
ekirpichov at gmail.com
Fri Dec 26 04:37:51 EST 2008
I'm parsing Java classfiles with Data.Binary, the code is here:
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?
More information about the Haskell-Cafe