On Tue, May 18, 2010 at 9:02 PM, Stefan Hajnoczi <stefa...@gmail.com> wrote: > On Tue, May 18, 2010 at 5:37 PM, Corentin Chary > <corentin.ch...@gmail.com> wrote: >> Did you try to profile using calloc in qemu_mallocz instead of malloc + >> memset ? > > No, I didn't try it. I don't see how it could perform on par with not > clearing memory at all. Something is going to have to clear that > memory when using memset() or calloc(). Either libc or the kernel (if > using mmap).
I believe that if the allocation size is large enougth, getting a zeroed page can be almost free with clever memory management. Could you try to re-run your test with calloc and see what it does ? Speeding up all mallocz calls is probably a good idea :) -- Corentin Chary http://xf.iksaif.net