3 ms·
Not exactly. Without running on the BEAM you're left with cooperative scheduling (handing back control to the scheduler) of processes instead of pre-scheduling
by brightball 10y ago
Not exactly. Without running on the BEAM you're left with cooperative scheduling (handing back control to the scheduler) of processes instead of pre-scheduling (the scheduler can stop you).
That makes it possible for one processor heavy operation to take over and slow down everything else. BEAM ensures that if you have millions of request coming through and suddenly 1000 4 day long operations kick off on the machine, that the millions of normal, smaller operations continue responding and performing as expected.
Fairly critical for the stability of real time systems.
The other piece here is that these processes are cheaper on the BEAM than any other platform in terms of RAM cost.
.5Kb / process on the Erlang VM. A goroutine in Golang is the next closest at 2kb.
The two combined are one of the big reasons why benchmarks don't tell the whole story with Erlang/Elixir. It's harder to measure consistency in the face of bad actors.