News for hackers. Stuff that matters.
Re:Energy Efficiency Across Programming Languages by ram_rar on Thursday September 14, 2017 @02:53PM (#15251260)
I am curious to know, if there is any explanation for why java performs better than Go.
Re:Energy Efficiency Across Programming Languages by topspin on Friday September 15, 2017 @01:09AM (#15254799)
Two decades of optimization probably account for that. From the paper:

    Moreover, the top 5 languages that need less energy and
    time to execute the solutions are: C (57J, 2019ms), Rust (59J,
    2103ms), C++ (77J, 3155ms), Ada (98J, 3740ms), and Java
    (114J, 3821ms); of these, only Java is not compiled.
That is an admirable accomplishment. JRE 1.8 has the most efficient "managed" language runtime tested.

The PHP result is interesting; they used 7.x which is roughly twice as efficient as older (5.x) versions; PHP 7 was primarily a (successful) effort to improve performance. If you extrapolate the PHP result to the old version (multiply by 2) it's nearly as bad as Perl and among the slowest/most costly. That certainly corroborates Facebook's several PHP re-implementations.

Re:Energy Efficiency Across Programming Languages by jaawn on Friday September 15, 2017 @02:54PM (#15259712)
The Java performance was the most interesting part of the results for me. I'm glad it got some attention. I have been developing the opinion for awhile that, as an industry, we've become far too avoidant of "pre-mature" optimization. It is astonishing to me how much slower a lot of this stuff is than Java.

Granted, I also think considering Java to be "not compiled" is a slight misrepresentation since it does get compiled to Java bytecode.

Re:Energy Efficiency Across Programming Languages by glibgil on Thursday September 14, 2017 @04:41PM (#15252324)
Go was invented in the 1970s and then placed on the self for 40 years
Re:Energy Efficiency Across Programming Languages by jsd1982 on Thursday September 14, 2017 @06:48PM (#15253119)
I personally enjoy Go but your comment gave me a chuckle since it's very true. Have your upvote, friend, for whatever they're worth on HN.
Re:Energy Efficiency Across Programming Languages by jcelerier on Thursday September 14, 2017 @03:23PM (#15251625)
20 years of optimizing tends to do this
Re:Energy Efficiency Across Programming Languages by ademarre on Thursday September 14, 2017 @06:05PM (#15252893)
I can't speak to the Java comparison, but the site says they used Go 1.6.3. The SSA back end introduced in Go 1.7 (amd64) came with a nice performance boost.

https://blog.golang.org/go1.7