From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 46F9DBC88 for ; Thu, 10 Feb 2005 17:50:42 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j1AGofJV023454 for ; Thu, 10 Feb 2005 17:50:42 +0100 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA27519 for ; Thu, 10 Feb 2005 17:50:41 +0100 (MET) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.196]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j1AGoewd007877 for ; Thu, 10 Feb 2005 17:50:41 +0100 Received: by rproxy.gmail.com with SMTP id a36so204824rnf for ; Thu, 10 Feb 2005 08:50:40 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=cgE4d0FmPit1N/Lhzk8AnIr6/VukVqJmaB/mRuEL0viBOTLJyp3Cihk6G7V5cSW/th8QOCH16EooC6BPb7lG2muT94Xjgmn1PdnOpRtRasGr2Om7v2QJe3RgMCswjIR6JSPr8xappJFQB7MPw2REMWplCduCKWKAoq8Usj17Ky8= Received: by 10.38.3.57 with SMTP id 57mr287610rnc; Thu, 10 Feb 2005 08:50:40 -0800 (PST) Received: by 10.38.104.66 with HTTP; Thu, 10 Feb 2005 08:50:40 -0800 (PST) Message-ID: Date: Thu, 10 Feb 2005 17:50:40 +0100 From: Marwan Burelle Reply-To: Marwan Burelle To: John Prevost Subject: Re: [Caml-list] Memory allocation nano-benchmark. Cc: caml-list@inria.fr In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <420B7A7E.90504@or.uni-bonn.de> X-Miltered: at concorde with ID 420B90E1.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 420B90E0.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 prevost:01 prevost:01 wrote:01 allocates:01 o'caml:01 chunks:01 chunks:01 malloc:01 pointer:01 malloc:01 lri:01 cduce:01 ...:98 ...:98 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_BY_IP autolearn=disabled version=3.0.2 X-Spam-Level: On Thu, 10 Feb 2005 09:59:53 -0500, John Prevost 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