The OCaml Journal just published an article about optimization:
"The OCaml programming language is unusually well suited to high-performance computing among functional programming languages because it provides a highly efficient code generator with a performant run-time and garbage collector. This makes it feasible to write high performance programs entirely in OCaml without having to drop to lower-level languages like C and Fortran for performance-critical sections of code. This article focuses on the internal representation of data structures. An overview of OCaml's data representation strategy is given. Tools to examine values in the heap, including OCaml's own Obj module, are described. Then several approaches to optimization that are related to data representations are covered, including closures, polymorphic variants, bounds checking, functors and integer arithmetic..."
To read this article and more, subscribe to The OCaml Journal today!