Open
Description
Array initialisation is likely to be the source of bottlenecks in parallel workloads. Array initialisation for arbitrary typed elements needs to be sequential since the elements need to be initialised to a sensible value before GC gets to see it. However, for primitive types, int
and float
, one can allow parallel initialisation. OCaml supports Array.create_float
, which returns uninitialised array, which can then be initialised in parallel. One can also safely return an uninitialized integer array by
let create_int : int -> int array = Obj.magic (Array.create_float)
Once the array is created, it can then be initialised in parallel.
Metadata
Metadata
Assignees
Labels
No labels