I found the Async.Ignore function. Is this:

1
Seq.init 10 (fun j -> async{ myArr.[j] <- fromArr.[j] |> mapFun} ) |> Async.Parallel |> Async.Ignore |> Async.RunSynchronously

preferable to this:

1
Seq.init 10 (fun j -> async{ myArr.[j] <- fromArr.[j] |> mapFun} ) |> Async.Parallel  |> Async.RunSynchronously |> ignore

(i.e. does it avoid allocating the unit array)

By on 1/28/2010 3:23 PM ()

I doubt it; I think that any execution of Async.Parallel will create the array. But if you are doing enough work that 'async' is useful, then ten times out of ten, allocating one single extra short-lived array object is not going to matter.

By on 1/28/2010 10:12 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper