3 ms·
I want to spend more time in OCaml, but without threads it's a tough sell. Modern performance requires parallelism with shared memory, and the current mainline
by ynniv 8y ago
I want to spend more time in OCaml, but without threads it's a tough sell. Modern performance requires parallelism with shared memory, and the current mainline solutions don't offer that.
Where threads aren't part of the equation, OCaml has become suddenly popular. That's telling.
- jasim 8y agohttps://pl-rants.net/posts/go-and-ocaml-scalability/ https://pl-rants.net/posts/go-and-ocaml-scalability/ has an interesting take where they found multi-process OCaml performing better than goroutines. I don't know how to interpret those measurements correctly, so any help there would be appreciated.
- ynniv 8y agoThis experiment has "embarrassingly parallel" data, ie there is little to no benefit to sharing data between computations. It's not surprising that multiprocess does well on this, but this is not common in most real world applications. Imagine a simple chat server, where every request needs to read and write shared state. Even when the application doesn't seem to have shared state, any in-memory caching requires it.
- jasim 8y agoThat makes sense. Thanks.
- anentropic 8y ago"most real world applications" is a meaningless phrase, I doubt anyone can quantify "real world applications" one way or the other also the result is still interesting, why wouldn't goroutines scale just as well, but apparently didn't?
- ynniv 8y agoThat's fair, but perhaps I can rephrase it to say that embarrassingly parallel applications are a well known edge case and not the norm.
- styluss 8y agoDid you try Lwt/Async? I'm a ocaml novice and i'm curious how far one can get with them.