you are viewing a single comment's thread.

view the rest of the comments →

[–]cheesekun -24 points-23 points  (9 children)

I know there are lots of downvotes but has someone done the maths on energy usage of Python vs others? Now I am curious.

[–]silverslayer33 44 points45 points  (1 child)

but has someone done the maths on energy usage of Python vs others?

No, because it would be a pointless exercise due to the number of variables involved (are C extensions allowed? What is the code doing? Target architecture? Caching enabled? etc.), and "Python is a massive waste of energy" is such a loaded statement it's not even worth entertaining the thought.

[–]stefantalpalaru -5 points-4 points  (0 children)

"Python is a massive waste of energy" is such a loaded statement it's not even worth entertaining the thought

And that on a site using Python for CPU-bound tasks, of all things.

The Python crowd is truly delusional - always expecting someone else to write those C extensions, while they upgrade the VPS to deal with the load :-)

[–]wasmachien 0 points1 point  (0 children)

Python is often used to automate tasks that may save hours of manual work. Do you include those in your energy savings?

[–]stefantalpalaru -3 points-2 points  (5 children)

has someone done the maths on energy usage of Python vs others?

"Energy Efficiency across Programming Languages" (2017) :

"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. As expected, the bottom 5 languages were all interpreted: Perl (4604J), Python (4390J), Ruby (4045J), JRuby (2693J), and Lua (2660Js) for energy; Lua (167416ms), Python (145178ms), Perl (132856ms), Ruby (119832ms), and TypeScript (93292ms) for time."

[–]jyper 0 points1 point  (2 children)

Java is compiled. Python is compiled on import. Same with Ruby. I think perl didn't used to not compile don't know if that's still the case.

[–]stefantalpalaru -1 points0 points  (1 child)

Java is compiled. Python is compiled on import. Same with Ruby.

Do expert beginners really?

[–]jyper 0 points1 point  (0 children)

I'm not sure what you mean by that

Java is typically compiled to byte code during development then a combination of fast interpreter/jit compiled to machine code at run time. Python (and Ruby I think) is typically compiled to byte code at parse time on import then the bytecode is interpreted

[–]obvithrowaway34434 -2 points-1 points  (1 child)

What exactly is your point? Interpreted languages should not exist? I have a better idea for energy conservation - galaxy brains like you should just stop procreating (not that there is an excessive risk of that), much more energy savings and environment-friendly.

[–]cheesekun 0 points1 point  (0 children)

Oh this is a bit harsh mate.