caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: David McClain <dbm@refined-audiometrics.com>
To: Jon Harrop <jon@ffconsultancy.com>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] HLVM stuff
Date: Sun, 27 Sep 2009 17:35:32 -0700	[thread overview]
Message-ID: <4DB7BEFB-70C6-4ADA-B0F9-4ED0717A85B6@refined-audiometrics.com> (raw)
In-Reply-To: <200909280014.58488.jon@ffconsultancy.com>


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




  reply	other threads:[~2009-09-28  0:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-27 17:43 David McClain
2009-09-27 19:25 ` [Caml-list] " Jon Harrop
2009-09-27 21:58   ` David McClain
2009-09-27 23:14     ` Jon Harrop
2009-09-28  0:35       ` David McClain [this message]
2009-09-28  1:25         ` Jon Harrop
2009-10-13 22:18         ` Jon Harrop

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=4DB7BEFB-70C6-4ADA-B0F9-4ED0717A85B6@refined-audiometrics.com \
    --to=dbm@refined-audiometrics.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=jon@ffconsultancy.com \
    /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).