Live data from Hacker News

Principles of Green Software Engineering

principles.green

71–80 of 99 posts

Re: Principles of Green Software Engineering

#71
post #37

I'm reminded of the waste many CI sets do. Where they download the same set of dependencies at the same versions for each run. No effort put into caching thing. There is so much bandwidth used because of that (I've seen the numbers for some projects and it's HUGE).

I have to turn off caching because it doesn't play well with our JFrog cache.

JFrog gets the artifacts on premises, but causes issues trying to get them to the build agent. The opportunity costs of having false negatives and positives from CI builds are simply not worth it.

Re: Principles of Green Software Engineering

#73

My mom keeps bothering me to turn off the light before I leave home while any of the Youtube video she watch costs as much energy as keeping my light on for days/months. If only people were more aware of the energy cost of Internet.

The power budget on big screen TVs has snuck up on people and doesn't get enough air time.

In many houses the TV is using more power than the fridge, and in some cases more than your old fridge did.

My partner also complains about lights or leaving the fridge door open while I fetch food or drink from several containers, but then leaves the TV on counting on it to turn itself off (in an hour).

I think I'm going to have to explain conductivity and heat capacity, and remind everyone that I replaced all of the lights in the house with LEDs (some of which were goddamned expensive).

Re: Principles of Green Software Engineering

#74
The topic of ranking programming languages by energy efficiency has been discussed before on Hacker News. Here is the paper previously discussed which has been updated in 2021:

Energy Efficiency across Programming Languages: https://sites.google.com/view/energy-efficiency-languages

I'm glad to see new(ish) languages take performance seriously: Rust, Go, Nim, Crystal, Julia. Some of the most popular languages (we all know which ones) are the least performative. But they make life easier for developers, or as programmers love to say 'more productive'. On the other hand, when it's programmers who are on the receiving end of slow, resource intensive apps, they'll complain loudly.

When performance is an issue in running programs, a common response is: hardware is cheap, just add another energy-guzzling server or use a more powerful computer.

This attitude is embarrassing when you consider that in every other industry there is a push for reduced resource usage and lower energy consumption. I don't think it's controversial to say a typed, compiled language gives you good performance for free (and the reduced computing resources that implies).

Aside: When PHP 7 was released, Rasmus Lerdorf, the creator of PHP, said the performance improvements meant fewer servers, smaller memory use and reduced CPU activity - all of which equalled less power or electricity consumed. (And remember this is an interpreted language.)

When you consider the millions of servers in use, that additional language efficiency adds up to a substantial saving in electricity use. You can watch a segment from his presentation below where he talks about this, including the calculations he made of potential CO2 savings:

Rasmus Lerdorf – "PHP in 2018" (extract from the 15 min mark): https://youtu.be/umxGUWYmiSw?t=15m16s

Re: Principles of Green Software Engineering

#75
post #3

None of the websites or posts on this topic that I've come across contain any numbers. Would it really make a difference for the average project? Honest question.

https://lowimpact.organicbasics.com/eur Is an example website that I enjoyed that shows you how much carbon you’re effectively saving by viewing their low impact version for each request.

Thanks, that's a very interesting resource.

I browsed around for about 5 minutes and apparently saved 153.74g. A Dutch person's average yearly emissions mount to about 9 metric tonnes.

Very.. very roughly that's 15% of my hourly emissions.

Considering I'd be very unlikely to order from a website like this, just imagine what we're saving on logistics in addition to that! :)

Joking aside, the impact is infinitely larger than I had expected. It could also be that my quick math is off.. I'll have to check later.

Re: Principles of Green Software Engineering

#76

Earlier quoted context omitted.

Tons, unsurprisingly. There are website energy calculators around.

I've always been skeptical of those. Especially the ones that do things like measure the brightness of the pixels. For the amount of time someone tends to spend on a single page it seems like optimizing just one page is like a water dropper in an ocean. Whereas, say, Visual Studio for instance is on my screen 6+ hours a day. But maybe my next web app I'll take that into consideration.

> I've always been skeptical of those.

CPU usage is a very accurate proxy of energy usage. Second to that, network traffic.

Simply ignore pages that use poor metrics.

> Whereas, say, Visual Studio for instance is on my screen 6+ hours a day.

...and some people have private jets, but this is whataboutism.

Re: Principles of Green Software Engineering

#77
Does this really matter to a "normal" software engineer? Or is this something that only really matters to the cloud engineers at AWS and the hardware engineers at Intel? I'd like this to be real but I'm sceptical it's just fluff.

Re: Principles of Green Software Engineering

#78

It seems most of these boil down to: build more efficient software. Software that is more efficient with the network and CPU is also cheaper to run. So the incentives are generally aligned. When I deploy a system I want it to run on 5 servers not 50 for cost reasons not because I'm being green. If I'm being green by accident, that's a bonus. I'm glad on the "measure" side it gives examples of how to measure (though I…

This only applies if you are the one running your own software.

Websites are often offending, because they are run by the clients, so it matters less: they get bigger, with more JavaScript, maybe hosted far away, etc.

I know of Website Carbon Calculator[0] that can put a number on this for a given site.

[0]: https://www.websitecarbon.com

Re: Principles of Green Software Engineering

#79

It seems most of these boil down to: build more efficient software. Software that is more efficient with the network and CPU is also cheaper to run. So the incentives are generally aligned. When I deploy a system I want it to run on 5 servers not 50 for cost reasons not because I'm being green. If I'm being green by accident, that's a bonus. I'm glad on the "measure" side it gives examples of how to measure (though I…

You have options as a developer. Instead of python/php/perl/ruby (and hundreds of others most of which I don't know) you can write your server side code in C/C++/rust/ada/ (again hundreds of others). You will spend a lot more energy compiling and debugging your code up front, but in the long run you will use less energy on all the server. But will you - every time you roll out an update there are a lot more compiler hours on the developer machines, and less on the server time to amortize it over.

Note that I didn't list managed languages like Java or C#. It isn't clear where they fall - they tend to defer a lot of the CPU until after the user work is done (garbage collection for example). I don't know if anyone has done any fair analysis on this so I'm going to leave it as an exercise for the reader.

Post reply on HN