
A Comprehensive Study on the Energy Efficiency of Java Thread-Safe Collections [pdf] - ghlp
http://gustavopinto.github.io/lost+found/icsme2016.pdf
======
OliverJones
Great work! Let's hope this is an early contribution to a novel way of
measuring computational complexity. Power drain, as much as time, is the
scarce resource both in data centers and in mobile devices. It's great to
think about measuring it.

Wouldn't it be great if our favorite IDEs showed a little yellow lightning
bolt indicating suggestions for reducing the power-consumption profile of the
code? Some of it could be obvious stuff (StringBuffer in place of string +
string in loops, for example). But nonobvious stuff could be flagged too.

Of course, I hope the authors or others will try the same sorts of things on
low-power mobile processors, and with workloads closer to the real world.

~~~
honkhonkpants
Where I work the IDE does indeed present this information prominently, if you
consider raw cpu usage to be a decent approximation for energy consumption. A
function using more than a certain amount of cpu in production is annotated
with a little mark and if someone changes it the change review system brings
the cost of the code to the attention of the reviewer so they have efficiency
in mind when reading proposed changes.

~~~
dman
Sounds impressive - is this a publicly available ide?

~~~
honkhonkpants
No it is a company-specific hack. The relevant thing would be to have the
profile data to begin with. Then you can work that into whatever annotation
scheme your IDE offers.

~~~
dman
Great - reading between the lines that would require

a. Gathering perf data in prod at scale

b. Aggregating it and mapping it back to source

c. Having that available within the IDE

Looks like youre working for a surprisingly clueful employer if they are doing
all of the above.

------
scarmig
In broad strokes, what are the most energy costly parts of a computation? One
must be particularly bad... I'm guessing CPU activity, because it generates
the most heat? If you broke it down further, what's the most expensive parts
of it?

What causes divergence between energy efficiency and time complexity? I would
expect both roughly scale proportionate to the number of instructions
executed.

------
cbsmith
Looking forward to the days I can compile code with a "-Oe" to optimize for
energy efficiency. ;-)

~~~
adrianN
-O3 is probably an excellent approximation. Faster programs tend to use less energy.

~~~
ghlp
Not necessarily true. Please check: [http://arcade.cs.columbia.edu/energy-
oopsla14.pdf](http://arcade.cs.columbia.edu/energy-oopsla14.pdf)

------
honkhonkpants
If we're going for least energy, wouldn't it make sense to compare amongst
languages? If it were one of my requirements I would not take Java as a given.
I would also not take C++ as a given. I'd measure and choose.

~~~
PeCaN
Part of the reason could be 1) Android and 2) even excluding Android, Java is
immensely popular for small, low-power systems.

------
redtuesday
Thanks for posting this. Because of it I just remembered that I saved a
slightly similar link [1] and the github repo of the used jvm/scala library
[2] into my bookmarks years ago, but haven't read them yet.

[1]
[https://hal.inria.fr/hal-00681560v3/document](https://hal.inria.fr/hal-00681560v3/document)

[2] [https://github.com/Spirals-Team/powerapi](https://github.com/Spirals-
Team/powerapi)

------
DiabloD3
This is very useful, but I hope they publish the code to perform this test.
Sunacle changes stuff all the time to increase performance, and the numbers
will change over time.

------
brokenwren
Wow! This is super-nerdy! Love it.

