[Haskell-cafe] First call to putStr takes far more time than subsequent calls

Alexey Shmalko rasen.dubi at gmail.com
Sat Jul 11 07:02:59 UTC 2015


On Fri, Jul 10, 2015 at 10:17 AM, Jonas Scholl
<anselm.scholl at tu-harburg.de> wrote:
> It could also be the case that libgmp itself has to be loaded at this
> point. Using strace it looks like it is mmapped into the memory, maybe
> linux is lazy and only reads the file on the disk at the moment it is
> accessed the first time (i.e. at the first call)? At least linux uses a
> similar approach for requested memory by a program.

I can confirm Linux is lazy in loading program's code. It maps it in
memory space, but doesn't load yet. That's also true for mmap.


More information about the Haskell-Cafe mailing list