caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Xavier Leroy <xavier.leroy@inria.fr>
To: Kevin Patrick Murphy <murphyk@ai.mit.edu>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] BigArray.Array2 vs Array.make_matrix
Date: Tue, 3 Dec 2002 16:33:57 +0100	[thread overview]
Message-ID: <20021203163357.A100@pauillac.inria.fr> (raw)
In-Reply-To: <3DE58BF1.936A93B4@ai.mit.edu>; from murphyk@ai.mit.edu on Wed, Nov 27, 2002 at 10:22:25PM -0500

> I was wondering what are the relative merits (in terms of speed,
> portability and ease of use) between using arrays of arrays, and the
> BigArray class.
> 
> While web browsing, I saw a couple of people claim that BigArray is
> signigicantly slower than the standard array class:
> 
> http://caml.inria.fr/archives/200105/msg00217.html
>  claims BigArray is 3 times slower
> 
> www.cs.cornell.edu/courses/cs612/2001sp/ projects/ocaml-arrays/OCaml.pd
>  claims BigArray is about 10 times slower

There are earlier discussions of this issue in the archives of the
caml-list.  See for instance my reply:

http://pauillac.inria.fr/bin/wilma_hiliter/caml-list/200207/msg00445.html

In general, bigarrays are slower than regular arrays, although the
slowdown depends a lot on how the code is written, e.g. ensuring that
bigarrays are fully monomorphic improves performance quite a lot.

The main purpose of bigarrays is not to speed up pure Caml code, but
to facilitate interfacing with external numerical libraries.

In some circumstances, bigarrays have a few added bonuses as well:
compact representation of arrays of small floats, small integers, and
complex numbers; support for dimensions >= 2^22 on 32-bit machines;
and no-copying slicing and shrinking operations.  But all this comes
at some expense in speed for raw array accesses.

> Plus an interface to some standard linear algebra code would be nice...

You mean, like LACAML?
  http://www.ai.univie.ac.at/~markus/home/ocaml_sources.html

- Xavier Leroy
-------------------
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


      reply	other threads:[~2002-12-03 15:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-28  3:22 Kevin Patrick Murphy
2002-12-03 15:33 ` Xavier Leroy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021203163357.A100@pauillac.inria.fr \
    --to=xavier.leroy@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=murphyk@ai.mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).