News for hackers. Stuff that matters.
Re:Why I absolutely love java by fleitz on Tuesday February 08, 2011 @11:07PM (#2196246)
TickCount has 1 millisecond accuray and it's actually milliseconds, which is what tipped me off to the low numbers. It actually takes 140 milliseconds to execute. I redid the code to not use Seqs and now it's down to 15 ms.

  // Learn more about F# at http://fsharp.net
  open System

  let consume x = ()
  let start = System.Environment.TickCount
  let arr = [| 1..4 |] 
  for i = 1 to 100000 do
    arr
    |> Array.filter (fun y -> (y % 2) = 0) 
    |> consume 

  let endTime = System.Environment.TickCount
  printf "%d milliseconds" (endTime - start)
Re:Why I absolutely love java by sfraser on Tuesday February 08, 2011 @11:11PM (#2196254)
Thanks for the follow up.

I do hope to learn more about F#, I am hearing good things about it.

Re:Why I absolutely love java by fleitz on Tuesday February 08, 2011 @11:16PM (#2196269)
http://flyingfrogblog.blogspot.com/2009/07/ocaml-vs-f-burrow...

Great article about how F# can approach the speed of C with some fancy inlining.