caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Benedikt Meurer <benedikt.meurer@googlemail.com>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] OCamlJit 2.0
Date: Tue, 16 Nov 2010 18:32:09 +0100	[thread overview]
Message-ID: <FD948F86-760B-48B8-94D3-81FF5315A088@googlemail.com> (raw)
In-Reply-To: <AANLkTik9KqFtHo7R6z7ujDFhFmAQGBgS-Ao=3u39mkoK@mail.gmail.com>


On Nov 16, 2010, at 18:07 , bluestorm wrote:

> To those of you who are lazy but still curious, I just read the report, and here are the answers to the question I had:

Thanks for posting these points, should have done this in my original post...

> 1. Is that project related to Basile Starynkevitch's venerable OCamlJIT ?
> 
> Yes, OcamlJIT was apparently a major inspiration for this work. The overall design is similar, and in particular the objective of absolute compatibility with the existing bytecode (even when it may hurts performances) was retained. Unfortunately, due to bitrotting and different architectures (OcamlJIT x86 vs. OcamlJIT2 x86_64), there is no direct performance comparison, though the reports seems to indicate similar to better performances. Several points were also improved (better (but still suboptimal) register usage, clever hacks to speed up mapping between bytecode and native code adresses...).

With the x86 port being close to complete, direct comparison with OcamlJIT will be possible (dunno if OcamlJIT will work with 3.12 tho). I'll do appropriate comparisons once everything is in place.

> 2. Does it use LLVM ?
> 
> No, it doesn't, but it's justified. Apparently, an early prototype showed than LLVM compilation/generation overhead was too high. A (debatable) design goal of OcamlJIT2.0 is to be absolutely faster than ocamlrun, even on *very* short-running programs (`ocamlc -help`).

This is indeed debatable, atleast for "ocamlc -help". But this was not the main concern with LLVM. LLVM overhead is acceptable for long running computations, but everything else is slowed down noticably. It should also be noted that my LLVM prototype was rather quick&dirty, so it may indeed be possible to get a LLVM based JIT which is on par with the byte-code interpreter for common applications. But why would one want to do this? Long running computations can be speed up very well using ocamlopt (no need to perform them using the interactive top-level).

> OCamlJIT2.0 uses its own macro to generate x86_64 assembly directly (apparently using a dedicated library wasn't worth it). A drawback of this strategy is its inherent non-portability.

It used AsmJit before, which is also limited to x86/x86-64; the non-portability is actually a design decision (as explained in my original post, portability to non-desktop machines was not a goal for the current implementation).

HTH,
Benedikt Meurer

  reply	other threads:[~2010-11-16 17:32 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-16 14:52 Benedikt Meurer
2010-11-16 17:07 ` [Caml-list] " bluestorm
2010-11-16 17:32   ` Benedikt Meurer [this message]
2010-11-17  8:44 ` Native toplevel? (was: OCamlJit 2.0) Alain Frisch
2010-11-17 10:46   ` Satoshi Ogasawara
2010-11-17 11:38   ` Sylvain Le Gall
2010-11-17 22:57   ` [Caml-list] Native toplevel? Wojciech Daniel Meyer
2010-11-18 16:49   ` [Caml-list] Native toplevel? (was: OCamlJit 2.0) Ashish Agarwal
2010-11-19 18:09     ` David MENTRE
2010-11-19 18:24       ` Hezekiah M. Carty
2010-11-19 18:30         ` Ashish Agarwal
2010-11-19 18:42           ` Benedikt Meurer
2010-11-20 11:49     ` Jon Harrop
2010-11-18 18:19   ` Benedikt Meurer
     [not found]   ` <2025993285.616104.1290144569061.JavaMail.root@zmbs4.inria.fr>
2010-11-19 10:02     ` [Caml-list] Re: Native toplevel? Fabrice Le Fessant
2010-11-19 19:16       ` Benedikt Meurer
2010-11-19 18:43 ` [Caml-list] OCamlJit 2.0 Yoann Padioleau
2010-11-19 19:10   ` Benedikt Meurer
2010-11-20 15:59     ` Yoann Padioleau
2010-11-19 19:46   ` Dario Teixeira
2010-11-19 20:20     ` Yoann Padioleau
2010-11-20 15:19       ` [Was: OCamlJit 2.0] Vincent Balat
2010-11-20 15:42         ` [Caml-list] " Benedikt Meurer
2010-11-20 16:10           ` Yoann Padioleau
2010-11-20 16:25             ` Benedikt Meurer
2010-11-20 17:35               ` Yoann Padioleau
2010-11-20 17:08             ` Jon Harrop
2010-11-20 17:37               ` Yoann Padioleau
2010-11-20 17:48                 ` Sylvain Le Gall
2010-11-20 18:51                   ` [Caml-list] " Jon Harrop
2010-11-20 18:05                 ` [Caml-list] " Jon Harrop
2010-11-20 17:15             ` Gerd Stolpmann
2010-11-23  2:09             ` Elias Gabriel Amaral da Silva
2010-11-24  7:20     ` [Caml-list] OCamlJit 2.0 Alain Frisch
2010-11-24  7:59       ` Yoann Padioleau
2010-11-24  9:04       ` Compiling to Javascript Jerome Vouillon

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=FD948F86-760B-48B8-94D3-81FF5315A088@googlemail.com \
    --to=benedikt.meurer@googlemail.com \
    --cc=caml-list@yquem.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).