English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2005-02-10 (16:50)
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