News for hackers. Stuff that matters.
Re:Elixir Saves Pinterest $2M a Year in Server Costs by mcintyre1994 on Tuesday August 29, 2023 @06:42AM (#37305710)
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.
Re:Elixir Saves Pinterest $2M a Year in Server Costs by tabeth on Tuesday August 29, 2023 @06:44AM (#37305738)
[deleted]
Re:Elixir Saves Pinterest $2M a Year in Server Costs by di4na on Tuesday August 29, 2023 @07:06AM (#37305939)
Yeah 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.

Re:Elixir Saves Pinterest $2M a Year in Server Costs by troupo on Tuesday August 29, 2023 @07:06AM (#37305932)
It 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

Re:Elixir Saves Pinterest $2M a Year in Server Costs by malodyets on Tuesday August 29, 2023 @08:52AM (#37307028)
I wish you wouldn’t delete your posts - it makes it hard to understand what the following comments are responding to.
Re:Elixir Saves Pinterest $2M a Year in Server Costs by pdpi on Tuesday August 29, 2023 @07:55AM (#37306386)
> 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