3 ms·
Actually, OCaml never generates objects like this on the stack - value creation is always taken literally. The OCaml compiler is really allocating all those re
by thelema314 16y ago
Actually, OCaml never generates objects like this on the stack - value creation is always taken literally. The OCaml compiler is really allocating all those records. It's just that their lifetime is almost zero, so the cost to clean them up is zero (as none get promoted from the minor heap to the major heap). And the cost to create them is almost zero, just a += and a compare.
- albertzeyer 16y agoAh, interesting. Does it also have a GC or some own custom allocation implementation? Because if it really would use something like malloc, I don't really see how it should be faster than the C version.