caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
To: jonathan.roewen@gmail.com
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] The Bytecode Interpreter...
Date: Sat, 22 Oct 2005 09:39:40 +0900 (JST)	[thread overview]
Message-ID: <20051022.093940.85425578.garrigue@math.nagoya-u.ac.jp> (raw)
In-Reply-To: <ad8cfe7e0510211524n7e9e944eleaf4d2be99e5a56c@mail.gmail.com>

From: Jonathan Roewen <jonathan.roewen@gmail.com>

> I've noted on the computer language shootout that ocaml bytecode is
> slow compared to Java. I'm curious, are there any plans to optimise
> the shit out of the bytecode interpreter? I know it has been a goal to
> not be much more than 1.3x slower than C -- but this only covers
> ocamlopt/native code. Don't you think bytecode should have some
> endeavour to match or better some other language too (Java seems best
> case to me in this scenario).
> 
> About the only thing the shootout proves is that ocaml bytecode has
> very good memory use compared to Java.

This is not at all surprising: you are comparing two very different
things. OCaml has a pure bytecode interpreter, while Java is a mix of
interpreter and run-time compiler (the famous "JIT"). Microsoft's CLR
is even more extreme, as all execution goes through the JIT. Their
only common point is that they take bytecode as input, but they run it
very differently. For a pure bytecode interpreter OCaml is pretty fast
(faster than caml-light, which was already very fast), but it cannot
compete with a compiler. There is also an experimental JIT runtime for
OCaml (ocamljitrun), but it suffers from the difference in the
bytecode design: OCaml bytecode is designed to run on a pure bytecode
interpreter, so it drops all type and control flow information (which
Java bytecode keeps), as it would not be useful for such an
interpreter. The advantage is compactness, and good memory use. This
also means that there is very little the JIT will be able to
optimize. Nonetheless ocamljitrun is about twice as fast as ocamlrun,
just because modern processors are very much geared towards compilers.

So your question could be expressed as: is there any plan for a more
expressive bytecode, that would allow JIT optimizations.
The answer is that I'm not aware of any.
A connected topic may be the language F#: a cousin of ocaml, built on
top of Microsoft's CLR, and as such benefiting from a very good JIT
runtime.

That's all I know.

Jacques Garrigue


  parent reply	other threads:[~2005-10-22  0:39 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-21 10:01 Jonathan Roewen
2005-10-21 11:27 ` David MENTRE
2005-10-21 22:24   ` Jonathan Roewen
2005-10-21 23:49     ` Oliver Bandel
2005-10-22 21:33       ` Jonathan Roewen
2005-10-22  0:32     ` Jon Harrop
2005-10-22  0:39     ` Jacques Garrigue [this message]
2005-10-23  1:03   ` Jonathan Roewen
2005-10-23 10:21     ` Gerd Stolpmann
2005-10-24  5:38       ` Jonathan Roewen
2005-10-24  6:13         ` Jacques Garrigue
2005-10-24  6:48           ` Jonathan Roewen
2005-10-22  0:39 ` Jonathan Roewen
2005-10-26  0:33   ` Jonathan Roewen
2005-10-26  9:56 ` Jonathan Roewen
2005-10-26 10:20   ` Jonathan Roewen
2005-10-27 14:12   ` Damien Doligez
2005-10-28 21:41     ` Jonathan Roewen
2005-10-29 11:29       ` Gerd Stolpmann
2005-10-29 15:22         ` skaller
2005-10-30  0:41           ` Jonathan Roewen
2005-11-10 10:26         ` Damien Doligez

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=20051022.093940.85425578.garrigue@math.nagoya-u.ac.jp \
    --to=garrigue@math.nagoya-u.ac.jp \
    --cc=caml-list@yquem.inria.fr \
    --cc=jonathan.roewen@gmail.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).