From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 6D5DDBC37 for ; Fri, 1 Jan 2010 22:14:38 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjoCAN70PUvUnwdki2dsb2JhbACbTAEBAQoLCgcRBog3rnCEMQQ X-IronPort-AV: E=Sophos;i="4.47,486,1257116400"; d="scan'208";a="40860063" Received: from relay.pcl-ipout02.plus.net ([212.159.7.100]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 01 Jan 2010 22:14:37 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAGf0PUtUXebi/2dsb2JhbACkQ65xhDEE Received: from relay03.plus.net ([84.93.230.226]) by relay.pcl-ipout02.plus.net with ESMTP; 01 Jan 2010 21:14:37 +0000 Received: from [87.114.35.173] (helo=leper.local) by relay03.plus.net with esmtp (Exim) id 1NQopR-0001EA-1n; Fri, 01 Jan 2010 21:14:37 +0000 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: Basile STARYNKEVITCH Subject: Re: [Caml-list] ocaml, llvm and generating code at runtime Date: Fri, 1 Jan 2010 22:29:02 +0000 User-Agent: KMail/1.9.9 Cc: caml-list@yquem.inria.fr References: <405ED4B9-9B3C-4BAA-9C79-C18BB8FDDB4D@gmail.com> <201001011908.48316.jon@ffconsultancy.com> <4B3E59C7.50106@starynkevitch.net> In-Reply-To: <4B3E59C7.50106@starynkevitch.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201001012229.02622.jon@ffconsultancy.com> X-Plusnet-Relay: fd0d74d9574ecdd7106dec02647e8855 X-Spam: no; 0.00; ocaml:01 runtime:01 basile:01 wiki:01 gcc:01 gcc:01 kloc:01 afaik:01 quicker:98 frog:98 wrote:01 compilers:01 caml-list:01 compiling:02 slower:02 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. http://www.ffconsultancy.com/?e