4 ms·
This is a repost of a low quality paper from 2017 [1]. It's low quality because they haven't done anything truly novel - they simply took the results of the ben
by nindalf 3y ago
This is a repost of a low quality paper from 2017 [1]. It's low quality because they haven't done anything truly novel - they simply took the results of the benchmarks game [2] and flipped it. The ones that ran faster are considered greener.
But there are so many other factors to consider. For example, if a language uses all available cores on the machine it's running on, that's a more efficient use of resources than ones that run single threaded by default. Unless of course, your deployment configuration has multiple processes scheduled so no cores are wasted (but assuming they're not bottlenecked by memory). But once we start discussing specifics like how individual deployments happen we can no longer make blanket statements about an entire language.
All that assuming the benchmarks game tells you something reasonable about how real world programs look. They're hyperoptimized by hand with inline assembly, barely readable. That's not normal.
The other issue is that real world programs are large, with dependencies that we pull in. Benchmarks game programs are relatively small and in a single file, no dependencies. Is that what the average Python, Javascript or Rust program looks like in production? What are we even comparing at this point?
They chose to use benchmarks game because it already existed and required minimal effort from them. I'm reminded of the alcoholic using a lamppost - more for support than illumination.
[1] - https://greenlab.di.uminho.pt/wp-content/uploads/2017/10/sleFinal.pdf https://greenlab.di.uminho.pt/wp-content/uploads/2017/10/sle...
[2] - https://benchmarksgame-team.pages.debian.net/benchmarksgame/box-plot-summary-charts.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
- flohofwoe 3y agoThe basic idea makes a lot of sense though when there's tons of server-side code running in interpreted PHP, Python or JIT'ted Javascript which would run 10x .. 100x faster and more energy efficient when picking any compiled language instead. Interpreting and JIT'ing wastes a lot of resources with identical but unnecessary work on each invocation that would only need to happen once before deployment. We're not recompiling C++, Swift or Rust applications each time they are started on the user's mobile phone either.
- nindalf 3y agoIt's certainly possible to make the case you're saying. And I would be interested in reading such a paper. But my view is that someone using the benchmarks game hasn't proved anything.
- flohofwoe 3y ago> How often do you restart the server so that the JIT compiling time matters? In a highly dynamic language like Javascript you have not much control on when which parts of the code might be 'de-optimized' and re-jitted (e.g. when the 'shape' of objects changes), it definitely doesn't only happen at startup or when a function is first called.
- igouy 3y agoThat view seems cynical rather than skeptical. Other comments you've made on this topic seem wrong on basic facts? https://news.ycombinator.com/item?id=39145414 https://news.ycombinator.com/item?id=39145414
- AstralStorm 3y agoHow often do you restart the server so that the JIT compiling time matters? (Moreover the result is often cached.) This point it's more relevant for full interpreters... And perhaps better compilers matter more than their performance - it just so happens that C and C++ compilers are the most developed at the moment. (Except perhaps some shader compilers and Fortran.) The JIT cost gets more egregious in JavaScript since it's paid by every user. Wasm is therefore much more efficient if we can skip the JS compiler...
- gpderetta 3y ago> For example, if a language uses all available cores on the machine it's running on, that's a more efficient use of resources I don't see how that's true. From an efficiency point of view, I think that what matter is resource usage per work done.
- nindalf 3y agoAre you considering the resources it took to create the chip itself? If you’re running a single threaded process on a multi core machine and nothing else, the rest of the processor is being wasted. Further, the way modern processors conserve power is by the “race to sleep”. If it can complete the task quickly, the processor enters a lower power sleep mode. Therefore a language that allows us to easily write multithreaded code will reach this state quicker and consume less power. It’ll be “greener”.
- gpderetta 3y agoSurely part of conserving resources is matching your hardware to the load. In the same way you wouldn't reserve a datacenter for a job that can be done on a single machine, you wouldn't reserve a large machine for a single-threaded load. You either pick a smaller, more efficient machine or do more work on that machine. Also if you are single threaded you do not have to race to sleep on all the other cores. They are already sleeping.
- igouy 3y ago> they simply took the results of the benchmarks game No, they selected some of the programs and made their own measurements. > The ones that ran faster are considered greener. No, they used Intel’s Running Average Power Limit (RAPL) to measure energy consumption.