It doesn't make a whole lot of sense to talk about the energy efficiency
of a programming language.�� For example, I've seen the run time of a
C benchmark go from 50 seconds to 1 microsecond when the optimisation
level was changed.�� It doesn't even make much sense to talk about the
energy efficiency of the code generated by a specific compiler with
specific options: the underlying hardware counts too.���� A colleague of
mine, looking at text compression algorithms for an information retrieval
engine, found that the fastest algorithm depended on just which x86-64
chip, even what motherboard, was in use.�� It's obviously going to be
the same for energy efficiency.
So let's specify a particular physical machine, a particular compiler,
and a particular set of compiler options.�� NOW does it make sense to
talk about energy efficiency?�� Nope.�� It's going to depend on the
problem as well.�� And the thing is that people tend to do different
things in different programming languages, and different communities
attract different support.�� There is no portable Smalltalk equivalent
of NumPy, able to automatically take advantage of GPUs, for example.
You can get some real surprises.
For example, just now while writing this message, I fired up
powerstat(8).�� I had the browser open and power consumption was
about 12.8 W.�� I then launched Squeak and ran some benchmarks.
Power consumption went DOWN to 11.4 W.
That is, Squeak was "costing" me -1.4 W.
If you understand the kind of things modern CPUs get up to, that
is not as surprising as it seems.�� All it demonstrates is that
getting MEANINGFUL answers is hard enough; getting GENERALISBLE
answers is going to be, well, if anyone succeeded, I think they
would have earned at least a Masters.