Lennart is working on speeding up the binary package (which I believe
is used to decode the .hi files.) His work might benefit this effort.
Last time I tested it, mmap still offered better performance than fread on linux. In addition to improving the deserialization code it would seem like a good idea to mmap the whole file at the outset as well.
It seems like readBinMem is the relevant function (readIFace -> readBinIFace -> readBinMem), which occurs here:
Currently it does one big hGetBuf to read the file. Since the interface files aren't changing dynamically, I think it's safe to just replace this code with an mmap.
It's nice to see that we have several wrapped versions of mmap provided on hackage:
Cheers,
-Ryan