About the Unboxed Float Arrays proposal

I just stumbled upon this:

https://www.lexifi.com/ocaml/about-unboxed-float-arrays/

Was this proposal considered?

Would it make array-using programs more efficient and memory-savy?

If so, that sounds quite interesting.

Note that the proposal is about removing the automatically unboxed float arrays and adding a specific
type for unboxed float arrays. There is thus no memory gain here, and the efficiency gains are only in terms of removing few runtime checks.

This is already implemented, but the option is only available with a specific non-default configuration flag. You can try it with opam switch create 4.09.0+no-flat-float-array.
Similarly, users of float array can future-proof their code by using Float.Array.ts, which are always unboxed, rather than generic float arrays.

1 Like

The proposal mentions a possible memory gain in the case of bool array.

This part was not implemented indeed, there was a PR implementing such optimized representation and much more but it is not under active development any more as far as I know.

1 Like