[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | David McClain <dbm@r...> |
| Subject: | Re: [Caml-list] HLVM stuff |
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