From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr 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 0ABDBBC37 for ; Mon, 28 Sep 2009 02:35:36 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiMCABuhv0rRVllBgmdsb2JhbACbAgEBCwsIBxUDtnqEHgU X-IronPort-AV: E=Sophos;i="4.44,462,1249250400"; d="scan'208";a="35109429" Received: from elasmtp-kukur.atl.sa.earthlink.net ([209.86.89.65]) by mail3-smtp-sop.national.inria.fr with ESMTP; 28 Sep 2009 02:35:35 +0200 Received: from [69.254.201.214] (helo=[10.0.1.2]) by elasmtp-kukur.atl.sa.earthlink.net with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.67) (envelope-from ) id 1Ms4DF-00006F-Uj; Sun, 27 Sep 2009 20:35:34 -0400 Cc: caml-list@yquem.inria.fr Message-Id: <4DB7BEFB-70C6-4ADA-B0F9-4ED0717A85B6@refined-audiometrics.com> From: David McClain To: Jon Harrop In-Reply-To: <200909280014.58488.jon@ffconsultancy.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: [Caml-list] HLVM stuff Date: Sun, 27 Sep 2009 17:35:32 -0700 References: <200909272025.39995.jon@ffconsultancy.com> <200909280014.58488.jon@ffconsultancy.com> X-Mailer: Apple Mail (2.936) X-ELNK-Trace: 7a0ab3eafc8cf994b22988ad1c62733440683398e744b8a46de49172ac86b34177bb267d63266634350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c X-Originating-IP: 69.254.201.214 X-Spam: no; 0.00; speedup:01 ocaml:01 0.34:98 wrote:01 caml-list:01 native:03 dbm:03 dbm:03 compiled:04 problem:05 parallel:05 sep:06 images:93 images:93 scan:06 On Sep 27, 2009, at 16:14 PM, Jon Harrop wrote: > Here is a better one-line F# solution: > > images |> Array2D.map (fun xs -> Array.sortInPlaceWith compare xs; > xs.[m/2]) > > This solves your problem from the REPL in 0.34s. Moreover, you can > easily > parallelize it in F#: > > Parallel.For(0, n, fun y -> > for x=0 to n-1 do > Array.sortInPlaceWith compare images.[y, x]) > images |> Array2D.map (fun xs -> xs.[m/2]) > > On this 8-core box, the time taken is reduced to 0.039s (finally a > superlinear > speedup on my Intel box, yay!). Yes, this is beginning to sound very interesting... So now that you have F#, which I understand to be some derivative of OCaml, why do you need HLVM? Is F# using the LLVM? or is it executing natively compiled code? From what I have garnered today in a quick scan of JIT docs, it appears that JIT cannot compete yet with native code. But if the timings you stated are for some kind of JIT against byte-codes, I am very impressed. Thanks for that... Dr. David McClain dbm@refined-audiometrics.com