Energy Efficiency across Programming Languages(Including Erlang)

Erlang do not have a good energy efficiency :expressionless:

Someone knows what is this Erlang v7.3.1.2 ??

Setup:
https://sites.google.com/view/energy-efficiency-languages/setup?authuser=0

Results:
https://sites.google.com/view/energy-efficiency-languages/results?authuser=0

It’s the erts version.This was what shipped with versions of OTP 18. So ~2 versions old.

Without looking at the code, it is impossible to tell. But they are using scientific computing workloads, which is the sort of computations that native Erlang code is not very good at (lower performance => longer runtimes => more system usage => more power). And who knows what their code is actually doing.

For general use of Elixir for the use cases it is actually intended for, those benchmarks are approximately useless.

2 Likes

And since OTP is released in about a yearly schedule its 2 years old as well. Usually we have a Major release each year about June, and not mor than a minor per quarter.

In general though I think @aseigo is right. The strict immutability, paired with copy on send does slow down calculations AND massively increases memory consumption, both things that boild down to higher use of system resources which again does cost more power.

And I have to support the request for code… Never trust any benchmark that does not show code and does not uncover the specs of the devices that were tested.

If there was a small mistake in implementing the benchmark then a function wich is not tail recursive but easily could be made one can really destroy the benchmark. If there was a very new/old/exotic processor used wich the ERTS wasn’t optimised for, but uses generic implementations for that family, it might blow up again.

But in general, of course, in C, C++, Rust (which are system langauges and do not have a fat runtime if at all) you can optimize your code much better for a target then you could in Erlang or Elixir. On the other hand, in the BEAM, we have very easy to use capabilities to delegate critical work to systems that are more suitable for a certain task. So you could do a really huge win by using the BEAM as glue to hold everything together while using C, Rust and whatever as a workhorse.

In general, what works best for your exact workcase, does need to be tested by you!

1 Like

Wtf? Whoever set those up was an idiot. You do not use the BEAM for math! You use it as IO and as glue for languages that are good with math. Blah…

1 Like

Hey! Nice to see my work being discussed.

You can actually check the measuring framework and all the code and benchmarks on the main page under [1]:

https://sites.google.com/view/energy-efficiency-languages

Take some time to read the paper also in [4] as we described in detail the whole process, where we obtained the code, etc :slight_smile:

2 Likes

Thank you for chiming in on this and making the original link set more complete, which only showed only small parts of your work without a link to the full one. Therefore there wasn’t that much we could discuss.

Now having access to the full work, makes things differently, and as far as I could see, it was an academic paper and therefore I do assume a certain level of quality. Its a pity that I do not have the time to actually read it right now :frowning: