From: Jon Harrop <jon@ffconsultancy.com>
To: caml-list@inria.fr
Subject: Re: [Caml-list] record field access
Date: Sat, 21 Oct 2006 08:23:39 +0100 [thread overview]
Message-ID: <200610210823.39902.jon@ffconsultancy.com> (raw)
In-Reply-To: <20061021035358.GB15596@malaquias.gwiceb1>
On Saturday 21 October 2006 04:53, j.romildo@gmail.com wrote:
> And to compare records with tuples, given also
>
> let dist3 (x1,y1) (x2,y2) =
> sqrt (sqr (x2 -. x1) +. sqr (y2 -. y1))
>
> what should be preferable: dist2 or dist3, regarding performance?
Specifically for all-float tuples and records, the internal representations
are different, with all-float records being unboxed. The performance
characteristics will be correspondingly different.
Otherwise, I don't know. I tried a lot of different combinations to try to
optimise my ray_sphere routine in the ray tracer. I got the impression that
it can affect register allocation, e.g. no CSE => pulling out {a.x=ax} in a
pattern requires an extra register but avoids repeated indirection (ax vs
a.x).
--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
Objective CAML for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists
next prev parent reply other threads:[~2006-10-21 7:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-21 3:53 j.romildo
2006-10-21 7:23 ` Jon Harrop [this message]
2006-10-21 14:07 ` [Caml-list] " Christophe Raffalli
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=200610210823.39902.jon@ffconsultancy.com \
--to=jon@ffconsultancy.com \
--cc=caml-list@inria.fr \
/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).