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 CC309BC88 for ; Thu, 10 Feb 2005 16:19:23 +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 j1AFJNwT009361 for ; Thu, 10 Feb 2005 16:19:23 +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 QAA23578 for ; Thu, 10 Feb 2005 16:19:22 +0100 (MET) Received: from smtp3.adl2.internode.on.net (smtp3.adl2.internode.on.net [203.16.214.203]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j1AFJKwO027764 for ; Thu, 10 Feb 2005 16:19:22 +0100 Received: from [192.168.1.200] (ppp212-197.lns2.syd3.internode.on.net [203.122.212.197]) by smtp3.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id j1AFJ6KD046765; Fri, 11 Feb 2005 01:49:16 +1030 (CST) Subject: Re: [Caml-list] Memory allocation nano-benchmark. From: skaller Reply-To: skaller@users.sourceforge.net To: =?ISO-8859-1?Q?Fr=E9d=E9ric?= Gava Cc: caml-list In-Reply-To: <005101c50f7f$6db0e560$d54380d9@mshome.net> References: <420B7A7E.90504@or.uni-bonn.de> <005101c50f7f$6db0e560$d54380d9@mshome.net> Content-Type: text/plain; charset=UTF-8 Message-Id: <1108048745.16698.101.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 11 Feb 2005 02:19:05 +1100 Content-Transfer-Encoding: 8bit X-Miltered: at concorde with ID 420B7B7B.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 420B7B78.003 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 sourceforge:01 gava:01 wrote:01 argv:01 glebe:01 ric:98 061:98 nsw:01 functions:01 int:01 snail:02 2037:02 string:03 programming:03 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=none autolearn=disabled version=3.0.2 X-Spam-Level: On Fri, 2005-02-11 at 01:47, Frédéric Gava wrote: > Hi, > > I think it is due to tablesize^3 applications of functions that are not > present in the C code. [skaller@pelican] ~>time ./a.out 250 real 0m3.303s user 0m2.850s sys 0m0.350s Using: let test tablesize = let table = Array.init tablesize (fun i -> Array.init tablesize (fun j -> Array.create tablesize 0)) in for i = 0 to tablesize - 1 do for j = 0 to tablesize - 1 do for k = 0 to tablesize - 1 do table.(i).(j).(k) <- (i+1)*(j+1)*(k+1) done done done ;; let _ = test (int_of_string Sys.argv.(1)) [skaller@pelican] ~>time ./xmem 250 real 0m3.327s user 0m2.760s sys 0m0.300s [skaller@pelican] ~>time ./cmem 250 real 0m0.706s user 0m0.150s sys 0m0.450s [I can't run it with >250 without the disk going nuts] -- John Skaller, mailto:skaller@users.sf.net voice: 061-2-9660-0850, snail: PO BOX 401 Glebe NSW 2037 Australia Checkout the Felix programming language http://felix.sf.net