3 ms·
If a given CPU can do X amount of work, with a C-based language you can maybe get 0.8X performance from that CPU. With elixir you might get 0.4X performance. F
by 20yrs_no_equity 10y ago
If a given CPU can do X amount of work, with a C-based language you can maybe get 0.8X performance from that CPU.
With elixir you might get 0.4X performance. From that perspective Elixir looks slow.
But you can deploy 10 servers and thus get 4X performance overall, with essentially no cost for Elixir. On the other hand to make distributed system in C you will spend 10X the development time.
So Elixir is fast in the sense that you get a distributed system much faster, and you can get more overall performance by scaling across multiple CPUs.
(And I'm kinda avoiding that on a quad core CPU your C program is really going to only use one core out of the box while elixir will use all four.)
These ratios are just examples, of course.
- gregpardo 10y agoYou can always call a c program for something you absolutely need speed for though right? https://github.com/elixir-lang/elixir/wiki/Interoperability-with-C https://github.com/elixir-lang/elixir/wiki/Interoperability-...
- vvanders 10y agoYup, and dirty NIFs for long running(>1ms) are just around the corner in BEAM.
- willyk 10y ago> And I'm kinda avoiding that on a quad core CPU your > C program is really going to only use one core out > of the box while elixir will use all four.) I think that's a pretty major factor to avoid -- multicore processors are the immediate/commercial foreseeable future of CPUs, so its not inconsequential that Erlang/Elixir allow you to be able to use cheap processes in order take full advantage of this