Live data from Hacker News

Python consumes 38x more energy than Java

stratoflow.com

1–10 of 142 posts

Re: Python consumes 38x more energy than Java

#5
While Java's compiler or JIT is probably one of the most optimized softwares in existence, how do we measure, what overhead the language nudges the programmers to build? I am thinking of AbstractProviderFactoryProxy and similar. Or that for a very long time it forced you (or still does to a degree) to put everything into classes, breeding 1 or 2 generations of programmers, who see a noun and jump to making a class and then subsequently initializing the class to be able to call a method, which actually would only need to be a standalone function.

It probably does not balance the 38x, and probably the JIT optimizes parts of it away, but surely the cost is far from zero.

Also what about the computational resources it takes to just run a JVM, compared to running a Python program?

Re: Python consumes 38x more energy than Java

#7
One should always be skeptical of these sorts of benchmarks, especially against Java, and I say this as primarily a Java developer.

Well optimized Java is very lean and can be incredibly performant, but the median modern Java app is an obese cronenberg made out of gigabytes of SpringBoot dependencies. That's not particularly fast; and well optimized python will run circles around it.

Re: Python consumes 38x more energy than Java

#8
post #3

The actual benchmark: https://benchmarksgame-team.pages.debian.net/benchmarksgame/... EDIT: fwiw, classic Fortran is twice as fast as java :P As is Rust, but that's less funny to me

Interesting, what is "Chapel"? Will need to look that up.

EDIT: seems to be https://chapel-lang.org/

Re: Python consumes 38x more energy than Java

#10

One should always be skeptical of these sorts of benchmarks, especially against Java, and I say this as primarily a Java developer. Well optimized Java is very lean and can be incredibly performant, but the median modern Java app is an obese cronenberg made out of gigabytes of SpringBoot dependencies. That's not particularly fast; and well optimized python will run circles around it.

This is an important point, real life performance looks nothing like benchmarks in most cases.

From my personal experience: benchmarks showed Jruby was MUCH MUCH faster the 'normal' Cruby. But try running a basic rails application on jruby and it's 10-100x slower, even after minutes of repeating the same request.

(disclaimer, this was a few years back and purely anecdotal)

Post reply on HN