Live data from Hacker News

Energy Efficiency Across Programming Languages

sites.google.com

121–130 of 143 posts

Re: Energy Efficiency Across Programming Languages

#121

Earlier quoted context omitted.

The tests come from the benchmark game. If you want to see Forth, implement the tests in Forth: http://benchmarksgame.alioth.debian.org/

@igouy points out that while the old shootout site is gone, its language files are still available[1]. There are about 70 benchmarks, in about 70 languages. I remember them as interesting multilingual browsing. Unlike the old shootout, adding languages directly to benchmarksgame.alioth.debian.org is not an option. "Because I know it will take more time than I choose. Been there; done that."[2] :) Instead, the code is…

> Unlike the old shootout, adding languages directly to benchmarksgame.alioth.debian.org is not an option

No, not unlike the old shootout -- exactly like it !

Please stop making things up.

Re: Energy Efficiency Across Programming Languages

#122

Earlier quoted context omitted.

The tests come from the benchmark game. If you want to see Forth, implement the tests in Forth: http://benchmarksgame.alioth.debian.org/

@igouy points out that while the old shootout site is gone, its language files are still available[1]. There are about 70 benchmarks, in about 70 languages. I remember them as interesting multilingual browsing. Unlike the old shootout, adding languages directly to benchmarksgame.alioth.debian.org is not an option. "Because I know it will take more time than I choose. Been there; done that."[2] :) Instead, the code is…

> There are about 70 benchmarks…

Most of which were replaced by something better.

Re: Energy Efficiency Across Programming Languages

#123
post #107
post #2

According to their normalized "global" results, something interesting i see: 1. Pascal, surprisingly, the most memory efficient of all. I should take a look at the implementation they used. 2. Rust a good alternative to C which leads in "energy efficiency" and speed. 3. Common Lisp most energy-efficient and fastest and smallest memory footprint of all the dynamic programming languages in the list -- like Python, Ruby…

> 5. I wonder which implementation of Lua they used. Lua can be pretty fast, one of the fastest dynamic languages out there. Apparently 5.3, but I am very skeptical of these results. Also the way the data is organised is very weird. One should not compare a JIT compiled VM (JavaScript) with interpreters (Lua, Python, Ruby...). An honest approach would have used LuaJIT, PyPy etc. or separated the languages into "famil…

> … but the ones in Lua weren't. Why?

No mystery: someone has made the effort to contribute all those multi-process Python programs; no one has made the effort to contribute all those multi-process Lua programs.

Re: Energy Efficiency Across Programming Languages

#124

Earlier quoted context omitted.

> It features an atypically high allocation rate compared to real-world programs. Do you have any supporting evidence for this? Real-world programs can be pretty allocation heavy, and if anything high allocation rates would "unfairly" benefit GC languages since native programs are banned from using arena allocators. > As a synthetic micro benchmark that only ever allocates objects of one size, it makes pool allocator…

> Do you have any supporting evidence for this? For starters, by virtue of the construction of the benchmark alone, which mostly is about stress-testing allocation. There are also quite a few papers that benchmark allocators, such as [1], where you can see that such allocation rates aren't exactly ordinary. > Real-world programs can be pretty allocation heavy, I said "atypical", not "impossible". Obviously, I can con…

> … my point is simply that the benchmark … tries to compare incomparable things.

That trump card wasn't actually mentioned in your original comment.

The difficulty is that programming languages (and programming language implementations) are more different than apples and oranges, but the question is still asked - "Will my program be faster if I write it in language X?" - and there's still a wish for a simpler answer than - It depends how you write it!

http://benchmarksgame.alioth.debian.org/dont-jump-to-conclus...

Re: Energy Efficiency Across Programming Languages

#125

Earlier quoted context omitted.

> Obviously, I can construct real-world programs with pretty much arbitrary allocation rates, but especially performance-sensitive code will avoid that, if only because it hurts memory locality. That's not actually true at all. Games, for example, can have high allocation rates. But they use custom allocators to make those allocations extremely cheap using things like arena allocators for the allocations for a frame.…

> It's not apples vs. oranges at all, though. It's "how can you solve this problem in the optimal way on any given language" And for any synthetic microbenchmark, that's unlikely to reflect real-world workloads, as they tend to narrowly test just one aspect of the language (or rather, its implementation). Remember, we're talking about a peer-reviewed paper here, where the burden to show relevance is upon the authors.…

> … and one reason why it calls itself a "game"…

No: http://benchmarksgame.alioth.debian.org/sometimes-people-jus...

> … and disavows usefulness for actual programming language comparisons…

Not a definitive conclusion but a starting point.

Re: Energy Efficiency Across Programming Languages

#126
post #107
post #2

According to their normalized "global" results, something interesting i see: 1. Pascal, surprisingly, the most memory efficient of all. I should take a look at the implementation they used. 2. Rust a good alternative to C which leads in "energy efficiency" and speed. 3. Common Lisp most energy-efficient and fastest and smallest memory footprint of all the dynamic programming languages in the list -- like Python, Ruby…

> 5. I wonder which implementation of Lua they used. Lua can be pretty fast, one of the fastest dynamic languages out there. Apparently 5.3, but I am very skeptical of these results. Also the way the data is organised is very weird. One should not compare a JIT compiled VM (JavaScript) with interpreters (Lua, Python, Ruby...). An honest approach would have used LuaJIT, PyPy etc. or separated the languages into "famil…

> One should not compare a JIT … with interpreters

Because ?

Re: Energy Efficiency Across Programming Languages

#127
post #73

I'm kinda surprised to see Go score so low on some of these, given that it's AOT-compiled to native code, and that its memory model and safety guarantees are optimization-friendly. I'm also kinda surprised that OCaml scored that high, considering how high-level it is.

OCaml has an incredible optimizer, and many of the abstractions that one would use in OCaml are transparent to the optimizer. You could say the opposite about Go.

Kinda makes me wonder why OCaml didn't become more popular for Unix systems programming, the way Go seems to be becoming now. Looking at the two languages, it seems like pretty much everything that Go has to offer in that department, OCaml has as well - and if it also optimizes better, why is this even a contest?

Re: Energy Efficiency Across Programming Languages

#128
post #126
post #107

Earlier quoted context omitted.

> 5. I wonder which implementation of Lua they used. Lua can be pretty fast, one of the fastest dynamic languages out there. Apparently 5.3, but I am very skeptical of these results. Also the way the data is organised is very weird. One should not compare a JIT compiled VM (JavaScript) with interpreters (Lua, Python, Ruby...). An honest approach would have used LuaJIT, PyPy etc. or separated the languages into "famil…

> One should not compare a JIT … with interpreters Because ?

Because they're "different families" of language implementation. A Just In Time compiler is a compiler. It looks like an interpreter, but it compiles the code to machine code and runs it.

Re: Energy Efficiency Across Programming Languages

#129
post #123
post #107

Earlier quoted context omitted.

> 5. I wonder which implementation of Lua they used. Lua can be pretty fast, one of the fastest dynamic languages out there. Apparently 5.3, but I am very skeptical of these results. Also the way the data is organised is very weird. One should not compare a JIT compiled VM (JavaScript) with interpreters (Lua, Python, Ruby...). An honest approach would have used LuaJIT, PyPy etc. or separated the languages into "famil…

> … but the ones in Lua weren't. Why? No mystery: someone has made the effort to contribute all those multi-process Python programs; no one has made the effort to contribute all those multi-process Lua programs.

Oh yes, that is true. But the person making the benchmarks should be aware of that and either look for better matching algorithms or implement them themselves.

Re: Energy Efficiency Across Programming Languages

#130
post #129
post #123

Earlier quoted context omitted.

> … but the ones in Lua weren't. Why? No mystery: someone has made the effort to contribute all those multi-process Python programs; no one has made the effort to contribute all those multi-process Lua programs.

Oh yes, that is true. But the person making the benchmarks should be aware of that and either look for better matching algorithms or implement them themselves.

Why should a comparison be restricted just because the best Lua programs-contributed fail to use multi core? (Tail wagging the dog).

If someone who didn't know Lua wrote those programs, then you'd complain that the programs weren't written by an expert.

If Lua wasn't included then I think you'd complain about that too.

Post reply on HN