caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Christian Szegedy <szegedy@t-online.de>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Memory allocation nano-benchmark.
Date: Thu, 10 Feb 2005 20:20:03 +0100	[thread overview]
Message-ID: <420BB3E3.1060005@t-online.de> (raw)
In-Reply-To: <cee4e1fb050210085044fa063e@mail.gmail.com>

Marwan Burelle wrote:

>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.
>
Actually, I have *filled* the arrays, as it may be clear from
the code. This example was extracted from a program which
massively shuffles around the content of this 3-dimensional grid.
(Both work fine and yield identical output.)

To my astonishment, the OCaml was a bit faster than C when
working on the grid, but the speed of allocation was nowhere
near to that of the C version.

This was a surprise to me, since I thought that OCaml is quite
competitive in this regard.


  reply	other threads:[~2005-02-10 19:20 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-10 15:15 Christian Szegedy
2005-02-10 14:47 ` [Caml-list] " Frédéric Gava
2005-02-10 15:19   ` skaller
2005-02-10 16:36     ` Frédéric Gava
2005-02-10 17:56       ` Frédéric Gava
2005-02-10 19:56         ` Christian Szegedy
2005-02-10 23:58           ` Frédéric Gava
2005-02-11  9:22           ` Frédéric Gava
2005-02-11 13:04             ` skaller
2005-02-11 13:33               ` skaller
2005-02-11 21:07               ` Oliver Bandel
2005-02-12  0:44                 ` skaller
2005-02-15 14:17                   ` Frédéric Gava
2005-02-15 19:19                     ` Christian Szegedy
2005-02-15 20:51                     ` Jon Harrop
2005-02-16  8:19                       ` Ville-Pertti Keinonen
2005-02-16  9:54                         ` Jon Harrop
2005-02-16 10:56                           ` Ville-Pertti Keinonen
2005-02-11  0:55       ` skaller
2005-02-10 14:56 ` Jon Harrop
2005-02-10 15:32   ` Ville-Pertti Keinonen
2005-02-10 14:59 ` John Prevost
2005-02-10 16:50   ` Marwan Burelle
2005-02-10 19:20     ` Christian Szegedy [this message]
2005-02-10 19:40       ` Jon Harrop
2005-02-11 11:26       ` Oliver Bandel
2005-02-12 13:42         ` Christian Szegedy
2005-02-11  1:04     ` skaller
2005-02-11 11:28       ` Oliver Bandel
2005-02-12  0:01         ` Guillaume
2005-02-12  0:36         ` skaller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=420BB3E3.1060005@t-online.de \
    --to=szegedy@t-online.de \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).