From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA25893; Sat, 8 May 2004 20:13:15 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id UAA25726 for ; Sat, 8 May 2004 20:13:12 +0200 (MET DST) From: briand@aracnet.com Received: from obsidian.spiritone.com (obsidian.spiritone.com [216.99.193.137]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i48IDASH021248 for ; Sat, 8 May 2004 20:13:11 +0200 Received: from soggy.deldotd.com (216-99-206-32.cust.aracnet.com [216.99.206.32]) by obsidian.spiritone.com (8.12.10/8.12.8) with ESMTP id i48ID9C9005894 for ; Sat, 8 May 2004 11:13:09 -0700 Received: from briand by soggy.deldotd.com with local (Exim 3.36 #1 (Debian)) id 1BMWJx-0006Bb-00 for ; Sat, 08 May 2004 11:13:09 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16541.9013.181806.9426@soggy.deldotd.com> Date: Sat, 8 May 2004 11:13:09 -0700 To: caml-list@inria.fr Subject: [Caml-list] interesting array efficiency observations X-Mailer: VM 6.92 under Emacs 21.2.1 X-Miltered: at concorde with ID 409D2336.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; observations:01 slower:01 arrays:01 bigarray:01 bigarray:01 float:02 cma:03 cma:03 let:04 let:04 layout:04 layout:04 array:04 array:04 efficiency:05 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I was investigating the use of 1-D bigarray's vs Array and noticed that the 1-D bigarray using c_layout seems to be slower than Array. Is this an expected result ? Thanks Brian ------------------------------------------------------------ let n = 10000 in let a = Array.create n 2. in for i = 0 to n-1 do for j = 0 to n-1 do a.(j) <- sqrt(a.(j) *. a.(j)); done; done; ------------------------------------------------------------ (* #load "bigarray.cma";;*) (* test file for big arrays. *) (* #load "bigarray.cma";; *) let n = 10000 in let a = Bigarray.Array1.create Bigarray.float64 Bigarray.c_layout n in for i = 0 to n-1 do for j =0 to n-1 do a.{j} <- sqrt(a.{j} *. a.{j}); done done ;; ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners