News for hackers. Stuff that matters.
Re:Which Programming Languages Use the Least Electricity? by FartyMcFarter on Sunday October 18, 2020 @07:49AM (#24817155)
In the "Is Faster Greener?" section, I'm surprised they didn't discuss threading. In the same wall-clock time, a benchmark that employs multi-threading heavily will presumably use much more power, due to more CPU cores being active.

Maybe their benchmarks were mostly single-threaded. But in general this is the first thing to look at.

Re:Which Programming Languages Use the Least Electricity? by gameswithgo on Sunday October 18, 2020 @07:57AM (#24817180)
have you actually checked that your claim tends to be true? n cores going almost n times faster with presumably some fixed overhead from the computer and threading might come out ahead
Re:Which Programming Languages Use the Least Electricity? by FartyMcFarter on Sunday October 18, 2020 @08:03AM (#24817213)
I said "in the same wall-clock time". If threading is done well, it will reduce wall-clock time, so I agree that threading could come out ahead.

What I was trying to get at is that if two languages perform the same task, but one of them uses multi-threading to accomplish it, "wall-clock time" is extremely likely to be a misleading proxy for power consumption.

It boils down to the fact that a CPU using all of its cores uses more power than a CPU using only one of its cores. This is easily checkable by listening to the fans on a fully loaded desktop PC, or by using software like "Core Temp" which can display CPU power consumption on some CPU models.

Re:Which Programming Languages Use the Least Electricity? by jmgao on Sunday October 18, 2020 @08:25AM (#24817305)
> It boils down to the fact that a CPU using all of its cores uses more power than a CPU using only one of its cores.

This is true if your cores are all the same and running at the same frequency, but voltage/frequency scaling make things more complicated and heterogenous cores like in essentially every modern ARM processor completely destroy it. If you have a bunch of slow cores that are half as fast but use a quarter of the power [1], using threads to split up the work so you can still meet your deadline can definitely save power.

1: https://www.semanticscholar.org/paper/Power-aware-task-sched...