caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Xavier Leroy <xavier.leroy@inria.fr>
To: William Chesters <williamc@paneris.org>
Cc: caml-list@inria.fr
Subject: Re: float array alignment; was Re: [Caml-list] Bigarray access speed
Date: Mon, 19 Aug 2002 14:56:05 +0200	[thread overview]
Message-ID: <20020819145605.A6276@pauillac.inria.fr> (raw)
In-Reply-To: <15708.56593.451087.185083@beertje.william.bogus>; from williamc@paneris.org on Fri, Aug 16, 2002 at 12:08:01PM +0100

malc writes:
> To get maximal speed of the inner loops data needs to be naturally 
> aligned. OCaml does nothing to enforce it for non-big arrays. Bigarrays on 
> the other hand are mmaped(4k on IA32) and you get perfectly aligned data 
> for free. I was thinking that maybe Array can be extended with
> make[create]_aligned, for speed/space tradeoff.

As William Chester said, allocating 8-aligned arrays isn't really
hard, but keeping them 8-aligned across copying collection,
compaction, and structured I/O is quite a pain.

My experiments indicate that the lack of alignment on float arrays 
(or more precisely the fact that they are 4-aligned instead of
8-aligned) has negligible impact on performance for the IA32 (Pentium)
and PowerPC processors, but non-negligible for SPARC and MIPS.
And of course on a 64-bit architecture the problem goes away because
everything in the Caml heap is then 8-aligned.  Since I expect IA32
and PowerPC to remain dominant until we massively switch to 64-bit
processors, there's no urgent need to do something about float array
alignment.

- 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-08-19 12:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-15 22:50 Richard Nyberg
2002-08-16 10:27 ` malc
2002-08-16 10:40   ` Markus Mottl
2002-08-16 11:08   ` float array alignment; was " William Chesters
2002-08-19 12:56     ` Xavier Leroy [this message]
2002-08-19 13:07       ` malc
2002-08-16 18:46   ` Richard Nyberg

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=20020819145605.A6276@pauillac.inria.fr \
    --to=xavier.leroy@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=williamc@paneris.org \
    /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).