From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 3C45ABC57 for ; Tue, 30 Nov 2010 23:06:55 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiUBAJ8D9UxKfVK0kGdsb2JhbACWJoxgCBUBAQEBCQkMBxEDH6lmi3wBBY4kAQSCE4M0 X-IronPort-AV: E=Sophos;i="4.59,282,1288566000"; d="scan'208";a="82023727" Received: from mail-wy0-f180.google.com ([74.125.82.180]) by mail2-smtp-roc.national.inria.fr with ESMTP; 30 Nov 2010 23:06:55 +0100 Received: by wyb29 with SMTP id 29so1469639wyb.39 for ; Tue, 30 Nov 2010 14:06:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:references :in-reply-to:subject:date:organization:message-id:mime-version :content-type:content-transfer-encoding:x-mailer:thread-index :content-language; bh=SIU/i4D30xejw+uDQ3tDDVirzmMfikyPHh/+Pl9Fa6k=; b=Gmj48guDwz6WoPFKLq0P9qPnkoakqu+4C1lORm5sHkvApx9xAeS0PmyBXdf3UvR9WZ YGqpXm1dGy8Avzh1AASLgm8EqJk+KKiDgNWO56SLPQhDQghKD55EKsO7M1OPo0rJw18h ro16eShQJgCDvBn9anuxOh8bset+Vt1v65KTo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=from:to:cc:references:in-reply-to:subject:date:organization :message-id:mime-version:content-type:content-transfer-encoding :x-mailer:thread-index:content-language; b=hcVipFFMozobGh+16BiBS9d9d9OgYMbAkTqO7xmubNmNw0sJlpu6aRZZuzy82L0mCz OW3T7s4V2dlc1tAnnKU6/8hFbjMeIxvR9fyRZYn2KcqG/CuVo+09J1by2Xe3vrvX+60s H5bz9yzy8uZl59SmHm8Ufi2w6/EvVngkcG1fY= Received: by 10.216.78.212 with SMTP id g62mr1148873wee.78.1291154814768; Tue, 30 Nov 2010 14:06:54 -0800 (PST) Received: from WinEight ([87.113.160.118]) by mx.google.com with ESMTPS id x3sm3269225wes.46.2010.11.30.14.06.53 (version=SSLv3 cipher=RC4-MD5); Tue, 30 Nov 2010 14:06:53 -0800 (PST) From: Jon Harrop To: "'Yoann Padioleau'" , "'bluestorm'" Cc: References: <3DCEA910-1382-47E5-876B-059178F8F82E@googlemail.com> <20101130124803.7952fca1@deb0> In-Reply-To: Subject: RE: [Caml-list] OCamlJIT2 vs. OCamlJIT Date: Tue, 30 Nov 2010 22:06:33 -0000 Organization: Flying Frog Consultancy Message-ID: <0a8b01cb90da$da5e6240$8f1b26c0$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcuQtLN8h5RJD+8cRou118ZNPw8i0gAH4t0w Content-Language: en-gb X-Spam: no; 0.01; ocaml:01 ocamlopt:01 compiler:01 ocamlopt:01 compilation:01 compilation:01 ocaml:01 cheers:01 1.5:98 1.0:98 2.0:98 1.5:98 1.0:98 2.0:98 wipe:98 Yoann wrote: > Yes, and it has to stop. I don't understand why there is so much hype around LLVM. Why > would you think something written in C++ would be far better than the ocaml code we have > in the ocamlopt compiler? Because benchmarks like my HLVM ones have proven that LLVM can generate *much* faster code than ocamlopt does. For example, Fibonacci function over floats in HLVM with optimization passes disabled and compilation time included in the measurement: # let rec fib (x: float) : float = if x < 1.5 then x else fib(x - 1.0) + fib(x - 2.0);; # fib 40.0;; - : `Float = 1.02334e+08 Live: 0 2.48074s total; 0s suspend; 0s mark; 0s sweep And ocamlopt without compilation time: $ cat >fib.ml let rec fib x = if x < 1.5 then x else fib(x -. 1.0) +. fib(x -. 2.0);; fib 40.0;; $ ocamlopt fib.ml -o fib $ time ./fib real 0m7.811s user 0m7.808s sys 0m0.000s Note that HLVM's *REPL* is over 3x faster than ocamlopt-compiled OCaml. I have microbenchmarks where LLVM generates code over 10x faster than ocamlopt (specifically, floating point code on x86) and larger numerical programs that also wipe the floor with OCaml. LLVM is also much better documented than ocamlopt's internals. Cheers, Jon.