3 ms·
I think Node is still single core by default? Elixir (or rather the Beam) will handle core utilisation so if you start a load of Elixir processes they’ll be spr
by mcintyre1994 3y ago
I think Node is still single core by default? Elixir (or rather the Beam) will handle core utilisation so if you start a load of Elixir processes they’ll be spread across multiple cores.
- _m8fo 3y ago[flagged]
- troupo 3y agoIt doesn't effectively do that. It does about 10% of that, ineffectively. Instead of running a single VM with full knowledge of how to run lightweight processes, designed to fully take advantage of modern multi-core CPUs with multiple guarantees enforced by the runtime you have multiple single-threaded VMs awkwardly communicating with each other over a bolted-on API
- di4na 3y agoYeah but then you have to handle a lot of the synchronization of memory. It is hard to make you realise what is possible on the erlang vm without having tried it. In particular, it is preemptive. This... Makes a lot of stuff easier.
- malodyets 3y agoI wish you wouldn’t delete your posts - it makes it hard to understand what the following comments are responding to.
- pdpi 3y ago> I think Node is still single core by default? It’s complicated. Node itself has never been single-threaded. The execution model for JavaScript is single-threaded, so there’s no working around that, but libuv uses threads to build async IO on top of blocking operations. Then there’s worker threads, which are pretty similar to web workers AIUI, that give you parallel execution for cpu-intensive work. Obviously, though, none of these facilities compare with BEAM