caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Christophe Raffalli <Christophe.Raffalli@univ-savoie.fr>
To: Rolf Wester <rolf.wester@ilt.fhg.de>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] OCaml speed
Date: Tue, 30 Oct 2001 17:24:38 +0100	[thread overview]
Message-ID: <3BDED446.F44A1A7D@univ-savoie.fr> (raw)
In-Reply-To: <3BCB2D45.29070.4316C73C@localhost>

Rolf Wester a écrit :
> 
> Hi,
> 
> I used the array access example from http://www.bagley.org/~doug/shootout/
> to compare c/c++ speed against ocaml. The sources I used are attached below.
> Unfortunately I could not confirm the given cpu times which are 0.11 sec for
> gcc and 0.13 for ocamlopt. My results on a Compaq Alpha True64 are
> 0.05 for cxx, 0.1 for g++ and 0.29 for ocamlopt. Does anybody have an idea
> what could be the reason for this inconsistency? Did I do anything wrong?
> 

Your code mainly does integer operations and array accesses.

The main difference between C and Ocaml are the reserved bit in integer used by
ocaml for the GC.
Then the generated assembly code are really different and it is possible that
this diffrence cost nothing (almost) on a pentium and a lot on a Alpha True64.

May be Xavier Leroy could look at the assembly code to tell if I am right ?

You could also try with float arrays which should make less difference for your
code ?

-- 
Christophe Raffalli
Université de Savoie
Batiment Le Chablais, bureau 21
73376 Le Bourget-du-Lac Cedex

tél: (33) 4 79 75 81 03
fax: (33) 4 79 75 87 42
mail: Christophe.Raffalli@univ-savoie.fr
www: http://www.lama.univ-savoie.fr/~RAFFALLI
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


  parent reply	other threads:[~2001-10-30 19:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-15 16:39 Rolf Wester
2001-10-16 21:33 ` Markus Mottl
2001-10-16 21:43 ` Doug Bagley
2001-10-30 16:24 ` Christophe Raffalli [this message]
2001-10-17  4:11 Jeremy Fincher
2001-10-17  8:01 ` Rolf Wester

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=3BDED446.F44A1A7D@univ-savoie.fr \
    --to=christophe.raffalli@univ-savoie.fr \
    --cc=caml-list@inria.fr \
    --cc=rolf.wester@ilt.fhg.de \
    /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).