English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
ocaml, llvm and generating code at runtime
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-01-01 (21:14)
From: Jon Harrop <jon@f...>
Subject: Re: [Caml-list] ocaml, llvm and generating code at runtime
On Friday 01 January 2010 20:23:35 Basile STARYNKEVITCH wrote:
> I heard that LLVM code generation time is significantly higher (i.e.
> slower) than other JIT technologies. So machine code generation time is
> apparently significant which might be an issue inside a web server) but
> performance of the generated code is supposedly good (inside a web server
> this is important only if the generated code runs a lot, in particular more
> than in a single session).
> I don't have enough personal experience to validate that claim.
> However, both MONO & PARROT sites are saying something similar:
> http://www.mono-project.com/Mono_LLVM
> http://trac.parrot.org/parrot/wiki/JITRewrite
> http://cliffhacks.blogspot.com/2007/03/experimenting-with-llvm.html
> But again, I may be wrong. Only real benchmarks on real applications can
> tell.
> I believe that libjit & GNU lightning should probably both generate machine
> code quicker than LLVM does, but the performance of the generated code (by
> libjit or by lightning) is worse than when using LLVM.
> And some benchmarks on
> http://www.phoronix.com/scan.php?page=article&item=apple_llvm_gcc&num=1
> suggest that LLVM generated machine code is less efficient than GCC
> generated machine code.
> Again, take all this with a grain of salt...

That's a fair assessment but LLVM is only about 2x slower than the fastest 
compilers and it generates code that runs 2-10x faster. For example, 
compiling the 155kLOC of LLVM IR generated by HLVM's test suite takes 9.65s.

I think it was a big mistake for the Go developers at Google and the Mono 
developers at Novell to not build upon LLVM.

My main concern about other JITs is maturity: AFAIK LLVM has orders of 
magnitude more users that all of the others combined.

Dr Jon Harrop, Flying Frog Consultancy Ltd.