caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: skaller <skaller@users.sourceforge.net>
To: Nicolas Cannasse <ncannasse@motion-twin.com>
Cc: "Michael D. Adams" <mdmkolbe@gmail.com>, caml-list@inria.fr
Subject: Re: [Caml-list] Efficency of varient types
Date: Sat, 26 Nov 2005 13:54:16 +1100	[thread overview]
Message-ID: <1132973656.21350.117.camel@rosella> (raw)
In-Reply-To: <4387ACC9.2040107@motion-twin.com>

On Sat, 2005-11-26 at 01:31 +0100, Nicolas Cannasse wrote:
> Michael D. Adams wrote:
> > I have recently learned about OCaml and have been impressed by how
> > fast it is in the benchmarks.  However I have discovered that variant
> > types can slow down a program quite a bit.  

> In order to understand what there is such difference, it's useful to 
> learn the ocaml memory model at runtime :

As everyone else says .. but I'll add my piece since I have studied
this particular function in great detail:

http://felix.sourceforge.net/current/speed/en_flx_perf_0005.html

The performance is *heavily* affected by stack space per
function call (in fact, directly proportional to it with
the limits of cache size). Boxing isn't an issue -- any
translator boxing anything in this test is out of the race.

This is a terrible function to choose to compare general
performance, precisely because it is so heavily dominated by
optimisation of stack use. More general benchmarks including
for example Jon Harrop's ray tracer show Ocaml does quite
well, despite boxing. So except in very particular cases,
I wouldn't worry too much about Ocaml being slow.

My own translator Felix (written in Ocaml) wins this test easily 
for unknown reasons -- trouncing even gcc, despite the fact
it actually generates C++ code compiled with gcc using
the same options.

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


  parent reply	other threads:[~2005-11-26  2:54 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-25 23:53 Michael D. Adams
2005-11-26  0:31 ` [Caml-list] " Nicolas Cannasse
2005-11-26  1:22   ` Brian Hurt
2005-11-26  9:39     ` Nicolas Cannasse
2005-11-28  0:17     ` Obj or not Obj Christophe Raffalli
2005-11-28  8:41       ` [Caml-list] " Nicolas Cannasse
2005-11-28  9:27         ` Christophe Raffalli
2005-11-28  9:33         ` skaller
2005-11-28  8:43       ` Alain Frisch
2005-11-26  2:54   ` skaller [this message]
2005-11-27  5:06   ` [Caml-list] Efficency of varient types Michael D. Adams
2005-11-27  5:45     ` Brian Hurt
2005-11-27 10:02       ` Nicolas Cannasse
2005-11-27 15:35       ` Michael D. Adams
2005-11-27 18:08         ` Brian Hurt
2005-12-02 15:07           ` Michael D. Adams
2005-11-26  1:18 ` Jon Harrop
2005-11-27 14:57 ` Lukasz Stafiniak
2005-11-27 15:47   ` Lukasz Stafiniak
2005-11-28  8:14   ` Christophe Raffalli
2005-11-28  7:24 ` David Baelde
2005-11-28  7:49   ` Jacques Garrigue
2005-11-28 10:01     ` Jon Harrop
2005-11-28 10:26       ` Luc Maranget
2005-11-28  7:53   ` Ville-Pertti Keinonen
2005-12-01 17:05 ` Stefan Monnier
2005-12-02 15:07   ` [Caml-list] " Michael D. Adams

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=1132973656.21350.117.camel@rosella \
    --to=skaller@users.sourceforge.net \
    --cc=caml-list@inria.fr \
    --cc=mdmkolbe@gmail.com \
    --cc=ncannasse@motion-twin.com \
    /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).