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 CAA26560; Sun, 21 Jul 2002 02:47:37 +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 CAA26567 for ; Sun, 21 Jul 2002 02:47:36 +0200 (MET DST) Received: from dewberry.cc.columbia.edu (dewberry.cc.columbia.edu [128.59.59.68]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g6L0ixv23969 for ; Sun, 21 Jul 2002 02:45:10 +0200 (MET DST) Received: from there (tw304h3.cpmc.columbia.edu [156.111.84.180]) by dewberry.cc.columbia.edu (8.9.3/8.9.3) with SMTP id UAA08888; Sat, 20 Jul 2002 20:44:28 -0400 (EDT) Message-Id: <200207210044.UAA08888@dewberry.cc.columbia.edu> Content-Type: text/plain; charset="iso-8859-1" From: Oleg To: Christophe TROESTLER , "O'Caml Mailing List" Subject: Re: [Caml-list] Bigarray map & set/get (long) Date: Sat, 20 Jul 2002 20:45:55 -0400 X-Mailer: KMail [version 1.3.2] References: <20020719.155940.19123621.Christophe.Troestler@umh.ac.be> In-Reply-To: <20020719.155940.19123621.Christophe.Troestler@umh.ac.be> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Friday 19 July 2002 09:59 am, Christophe TROESTLER wrote: > let mac out a b c = >   for i = 1 to Array2.dim1 a do >     for j = 1 to Array2.dim2 a do >       out.{i,j} <- a.{i,j} +. b.{i,j} *. c.{i,j} >     done >   done; >   out Chris, If you are using fortran layout (column-major) why are you incrementing rows in the inner-most loop? (AFAICR this can make a big difference with GCC, perhaps O'Caml too). Also, each loop seems to contain a call to function Array2.dim2. Can't this number be cached? Thirdly, does bigarray access check bounds? Can this be turned off? And finally, you might try to experiment with 0-based indexing [1], it may turn out to be faster. HTH Let me/us know how this turns out, Oleg [1] I absolutely abhor 0-based indexing in most modern languages ------------------- 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