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 FAA18171; Thu, 25 Jul 2002 05:23:11 +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 FAA18182 for ; Thu, 25 Jul 2002 05:23:10 +0200 (MET DST) Received: from relay.pair.com (relay1.pair.com [209.68.1.20]) by concorde.inria.fr (8.11.1/8.11.1) with SMTP id g6P3N9H03420 for ; Thu, 25 Jul 2002 05:23:09 +0200 (MET DST) Received: (qmail 98821 invoked from network); 25 Jul 2002 03:23:06 -0000 Received: from node-d8e9cca2.powerinter.net (HELO checkerlap.d6.com) (216.233.204.162) by relay1.pair.com with SMTP; 25 Jul 2002 03:23:06 -0000 X-pair-Authenticated: 216.233.204.162 Message-Id: <4.3.2.7.2.20020724194422.028aa970@mail.d6.com> X-Sender: checker@mail.d6.com X-Mailer: QUALCOMM Windows Eudora Version 4.3.2 Date: Wed, 24 Jul 2002 20:02:04 -0700 To: "O'Caml Mailing List" From: Chris Hecker Subject: Re: [Caml-list] Bigarray map & set/get (long) In-Reply-To: <20020722113136.A10720@pauillac.inria.fr> References: <20020719.155940.19123621.Christophe.Troestler@umh.ac.be> <20020719.155940.19123621.Christophe.Troestler@umh.ac.be> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >In the applications for which Bigarray was initially intended, the >Caml code that manipulates directly the bigarrays isn't >time-critical: the time-critical computations are done by external >libraries such as BLAS, Lapack, etc. Your matrix multiplication code >is a good example: if you care about its performances, then you need >to make it a lot more sophisticated so that it will be cache-friendly >(e.g. blocking); better use an existing, well-tuned C or Fortran >implementation than try to do your own in Caml. The problem with this is that sometimes you don't want the discontinuity and inconvenience of calling to C. Obviously, it'd be nice if we could do everything in ocaml from a simplicity and consistency standpoint, assuming it's not an infinite amount of work to get there. There is an important middle ground between "not caring about speed" and "needing the highest end BLAS performance", and since CPUs are making bad code fast faster than they're making good code fast, the middle ground is moving higher up the importance ladder, and getting easier to attain. When I looked at it a few months ago, there actually only seem to be a few things that are needed to make bigarrays as efficient as C float * arrays for most operations. I don't have my list handy, but when I get around to optimizing my game I hope to implement some of these into the compiler. Off the top of my head, I think bounds checking made a measurable difference, as did the indirection in the way the bigarray header structures are stored on the heap (even when they're going through the optimized path in the compiler), and it would be easier to write a lapack-style modularized matrix library if there was the concept of taking a "pointer" into a 1D bigarray that was lower level than the currently exising slice and subarray stuff (so that you can pass a pointer to a submatrix + a stride around). Chris ------------------- 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