caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: skaller <skaller@users.sourceforge.net>
To: Florian Hars <hars@bik-gmbh.de>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Re: Ocaml for Scientific computing
Date: Wed, 26 Sep 2007 18:53:28 +1000	[thread overview]
Message-ID: <1190796808.6800.87.camel@rosella.wigram> (raw)
In-Reply-To: <46FA1800.90406@bik-gmbh.de>

On Wed, 2007-09-26 at 10:27 +0200, Florian Hars wrote:
> skaller schrieb:
> > I guess that this is easier. How much speed is gained eliding
> > bounds checks?
> 
> It may even make the code slower:
> 
> http://caml.inria.fr/pub/ml-archives/caml-list/2004/01/679987f7b8b70e4cd9f088ac4e6c8097.en.html

Yes, I tend to agree with Xavier's analysis.
This may also explain why C code generated by Felix is 
often faster than hand written C code: on AMD64 Felix
generated C code for Ackermann's function is almost the same
as the hand written C, but runs 2x faster, and 2.5x faster
than Ocamlopt generated code.

At this point with gcc as the compiler and using stack
programming (no heap), I'm now expecting Felix to beat
C on all programs (and if it doesn't it's a bug 
in the compiler that needs fixing).

I am guessing this is because GCC has good SSA analysis,
and it works a lot better on goto spaghetti with a fixed
stack frame of the kind Felix tends to generate, than
block structured C code using for loops, etc.

So I'd add to Xaviers comments on processor behaviour
that small differences in source code structure can make
a big difference to compiler technology.


-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net


      reply	other threads:[~2007-09-26  8:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-25 17:27 Mike Lin
2007-09-25 18:46 ` [Caml-list] " skaller
2007-09-25 20:38   ` Jon Harrop
2007-09-25 21:01     ` skaller
2007-09-26  8:27       ` Florian Hars
2007-09-26  8:53         ` skaller [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=1190796808.6800.87.camel@rosella.wigram \
    --to=skaller@users.sourceforge.net \
    --cc=caml-list@yquem.inria.fr \
    --cc=hars@bik-gmbh.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).