Version française
Home     About     Download     Resources     Contact us    
Browse thread
Memory allocation nano-benchmark.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Marwan Burelle <slashvar@g...>
Subject: Re: [Caml-list] Memory allocation nano-benchmark.
On Thu, 10 Feb 2005 09:59:53 -0500, John Prevost <j.prevost@gmail.com> wrote:
> In a program that allocates one very large chunk of memory, I suspect
> you will find that both C and O'Caml do a lot better when... you
> allocated as one very large chunk of memory (or, if need be, a *tiny*
> number of large chunks) instead of as many small chunks of memory.

It also depends on malloc, on Linux it sometimes works
"optimisticaly", that is, it won't realy allocate memory unless you
use it (leading to some strange out of memory error, since it can
return a non-Null pointer even if memory isn't available.) So, a C
program with a lot of malloc and no usage of the memory allocated
could be faster than it realy is ...

My 2cc.

-- 
Burelle Marwan,
Equipe Bases de Donnees - LRI
http://www.cduce.org