News for hackers. Stuff that matters.
Re:For Better Computing, Liberate CPUs from Garbage Collection by rbehrends on Thursday May 09, 2019 @07:22AM (#19867136)
Thanks, but I do not plan to extend this project to other languages. I put it together a while ago as an illustration that conventional wisdom regarding GC cost is not what many people think.

If I were to expand it, I'd look at other allocation patterns rather than more languages; I've already good a fairly good cross-section of garbage collectors and malloc() implementations, so I don't really need any more.

Re:For Better Computing, Liberate CPUs from Garbage Collection by eru on Thursday May 09, 2019 @07:41AM (#19867257)
Fair enough. Well, too late, I just hacked together a Haskell version based on the OCaml version. It's naive code, but 16 times faster (0.235s vs 3.818s).

So I expect some GHC specific optimizations are kicking in. Eg GHC is probably smart enough never to construct the whole tree at once. Whether that counts as the kind of static analysis static of object lifetimes someones else in this thread talked about or not, I don't know.

Update: I think it's just common subexpression elimination kicking in..