407 comments

[ 2.8 ms ] story [ 300 ms ] thread
Stop including megabytes of javascript in every page, and composing pages from 100s of requests to microservices. In short, keep things simple.
Maybe don't make autoplaying videos? Those must use up bandwidth, maybe more than javascript. They also use power to decompress on client side.
I find it disappointing that so many sites pull down so much JS that a video maybe uses more bandwith.
It’s a fascinating failure as an industry - there is a ton of infrastructure around media optimization but our attitude about adding JS dependencies has been “there’s always room for one more”. I’ve seen more than a few cases where someone loaded an image optimization library where the JavaScript used more transfer, CPU, and memory than the original images, as if this wasn’t one of the easiest things to measure.
But what should we do when things are actually complex?

There is a lot of negativity here on HN on the same things you mentioned, but I fail to see any viable alternatives.

Like what? Replace the MB of JS with plain Html and forms? It's not going to be simpler to code, and it's definitely not going to be simpler for the users. Or maybe use a native desktop app? Then it's even more complicated for the users, and coding it leads you in world of cross platform pain. And the closest thing there was to not using MB of Javascript and have decent UX was Java and applets/jlnp, but it somehow didn't manage to be widely adopted.

Shot in the dark here, but perhaps you could try leaving the functionality the same and just try taking out all that code that tracks every pixel the user looks at, for how long, and how they can better market porn to that user...seems like that stuff could be taken out...
(comment deleted)
I wonder what the economic impact of doing that would be.
If everyone did that? Probably very positive in terms of energy and resource use, positive in terms of less things to worry about for the businesses - and very negative for all the bullshit adtech jobs that wouldn't be needed anymore.

So strongly positive, in other words.

One has to remember that marketing and advertising have a big negative-sum-game component going on, where most or all of your marginal effort to promote your product serves only to cancel out the marginal effort of your competitors to promote their products.

>If everyone did that? Probably very positive in terms of energy and resource use, positive in terms of less things to worry about for the businesses - and very negative for all the bullshit adtech jobs that wouldn't be needed anymore.

It's not just the annoyance factor, it's the bloat from ads. In fact, something like 48% of retrieved data[0], on average is ad related.

Getting rid of those ads could cut client (and server and network) energy draws significantly. And we could further reduce energy usage by not needing add-ons like ad/tracking blockers and stuff like NoScript[1].

I browse with js disabled and, unless I need to visit a particular site, I'll just close the tab if js is required -- as the bloat, the security risks and the hubris of js overuse is just too much.

[0] https://www.nextpit.com/ads-consume-half-of-your-mobile-data

[1] https://noscript.net/

Edit: fixed spacing of referenced links.

What programmer wants to add those things? Ads have been the bane of the internet for 20 years, how many times has a developer excitedly clamored to ruin their performance metrics, layout, security, etc with more ads? How often are programmers arguing for incredibly complex UI elements over the native (and trivial to implement) alternatives?

Programmers don't choose these things, because programmers aren't the real decision makers, it's management and business that makes the web awful.

Are you saying that the executioner is not a murderer because he doesn't make decisions about who to execute and who to leave alive ?
"how many times has a developer excitedly clamored to ruin their performance metrics, layout, security, etc with more ads?"

Depends how much traffic they have I suppose. I'd be pretty excited if ads bought me a Lamborghini for every color of the week because Tuesdays right now are pretty boring.

> What programmer wants to add those things?

The one that wants to keep their job.

> How often are programmers arguing for incredibly complex UI elements over the native (and trivial to implement) alternatives?

The existence of Bootstrap and Semantic UI suggest that programmers are in fact often arguing for incredibly complex UI elements over the native alternatives.

Of course, I tottally agree. I am not talkng at all about tracking, and 3rd party services at all.

I was talking mostly about the actual application logic and presentation.

BTW tracking is hapening even w/o javascript.

Its not adds its shovelling massive amounts of bloated JavaScript frame works in and hoping for the best and in a lot of cases just not understanding how to structure a website.
Why wouldn’t it be simpler to code? When you do server side rendering with HTML forms you reduce complexity by having more pages.

It is somewhat more complex to handle more pages in your code base, but each page is short and simple.

State management is harder to do when running an app with a 50/50 split across browser and server.

You end up with a lot of complexity around cookies/local storage (and trying to persuade users that cookies are not bad and that their virus checker should not delete the cookies please ...) or encoding the session ID in the URL and hoping that users do not share links or bookmark pages, and then of course you end up with the "please only click once" links around buttons etc.

You also now need two teams to code the front end - one that knows HTML etc, and one that knows the backend-frontend language (although could be nodejs of course). It is an extra interface that needs to be designed and maintained with all the opportunities for screwups that come with it.

Why would you need all that state management in the frontend if most of the rendering is on the backend?

We already have two teams today, one for the overly complex frontend and one for the backend. Solution to that is server side rendering and full stack developers.

>You also now need two teams to code the front end - one that knows HTML etc, and one that knows the backend-frontend language

Or, you could hire some full-stack developers and let them split the work more efficiently.

I've written apps like this and have to wonder what on earth you're doing because this is very straight forward.

Put a session id in a cookie and use a relation table to point at the tables owned by the user. This takes very little code. The alternative is managing a distributed database, half of which has to run in the browser. That actually sounds much harder (although not surprising for a startup.)

If users are deleting first party cookies than it's their own fault. Tracking state on the website you've visited is the entire point of cookies. If the user throws their phone on the ground really hard your website also won't run on it.

Yes, lots off apps today have the entire schema replicated in the browser, which means that every schema change you do in the backend must be replicated in the frontend. Madness.

If your UI is a copy of the database why not just give the user a phpmyadmin login instead?

> why not just give the user a phpmyadmin login instead?

The guy at the previous company said we can't do that.

You can use one of the many servers that manage the users session for you and only override it if needed. Is there any real problem with a server that uses a cookie to only store the users session ID, storing the other data related to the session ID on the server? For most sites I wouldn't think there would be any issues with it.
Developer can stop using webpack to bundle 3rd party libraries. Let browser cache it.
+1. If you're only targeting evergreen browsers you can already use syntax like `import Library from './library.js'`, plus lots of modern ES6 features.

For IE11 just load polyfills and let the 2-10% of IE11 users pay the tax, instead of making all your users in modern browsers download giant bundles.

Cross origin browser cache is a no-go for Safari (and hopefully other browsers will follow suit), 3rd party scripts from a CDN are not cached across different domains. The only way to properly cache things longterm is with webpack records, but not many people can bear with the added complexity of maintaining them in their pipelines.
For almost every "web professional", the things they do are not complex. It follows then that the likelihood of this question (to a reader that doesn't know you) being asked by someone who simply doesn't understand what it means to be simple. The casual observer is further lured down this path of reasoning because of your implications that a plain form is somehow worse than something mediated by megabytes of javascript. In almost every case you'll find online, this isn't true.
You don’t avoid using JS at all but only use it where it benefits the user. For example, the users benefit from having those forms having nice validation, dynamic lookups, etc. but they don’t benefit from using a vDOM on top of the far more efficient browser DOM or loading an entire general purpose templating framework instead of just using the DOM to update an existing form.

Those are things which developers do because they think it’s easier than learning the web standards or looks better on their résumé and as long as you avoid measuring actual performance you can sustain these beliefs for a long time even while your users are seeing performance below the level of a 2000s Rails app with worse error handling.

> You don’t avoid using JS at all but only use it where it benefits the user. For example, the users benefit from having those forms having nice validation, dynamic lookups, etc. but they don’t benefit from using a vDOM on top of the far more efficient browser DOM or loading an entire general purpose templating framework instead of just using the DOM to update an existing form.

I am sorry, are you talking about example todo app ? because for most apps with complex navigation, data entry, and validation this is absolutely not true. Just use the DOM , might be somehow feasible with webcomponents, but they are years late to the game.

> most apps with complex navigation, data entry, and validation this is absolutely not true.

You mean we just imagined all of that existing? You could make an argument saying you personally haven’t learned how to do it but that’s a far cry from “absolutely not true”.

That's not a solution; making simple stuff is harder than doing complicated stuff, and it costs much, MUCH more.
This is a dangerous question but - why is that the case? Why is simple software so much more difficult to write?
Anyone can write a sequential .py file with redundant if/else statements. It takes more than 1 hour to learn how to refactor that into concice functions or objects. It takes more than 100 hours to learn how to golf that into 30 bytes.
"Simple software" does not mean "golfed". Quite the opposite, actually.

What the grandparent is suggesting is using simpler architectures, not necessarily smaller (in the code-golf sense) code.

Fair point, but at least part of golfing is cutting out anything redundant (although much more than that, which can get into obfuscation territory). Code I'm impressed with is generally when it gets the job done in the most concise/simple (while readable) manner. That is by rule done by the most experienced programmers.

To paraphrase Pascal:

> I would have written a shorter letter, but I did not have the time.

Here are two utterly trivial examples of some JS;

    for (let x=0; x < 10000; x++) {
        if (x===0) console.log(x);
    }
versus

    for (let x=0; x < 10000; x++) {
        if (x===0) {
           console.log(x);
           break;
        }
    }
The second one is more code but much more efficient. Having a smaller amount of code doesn't translate in to having faster or more efficient code.

This is the basis of most optimization work - you're optimizing code to do the minimum amount of work, and very often that means writing more code. A moderately complex React/Vue/Svelte app will be much more energy efficient than a naive vanilla JS alternative because most frameworks to clever and hard things to reduce the amount of work that's done in order to increase performance, and a side effect of that is using less energy.

If you write it from scratch you could just get straight to the point with

    console.log(0);
It's an incredibly trivial example. With real world code you can't always do that. I hoped that would be obvious.
With the code above, an optimizing compiler might actually produce this line.
> A moderately complex React/Vue/Svelte app will be much more energy efficient than a naive vanilla JS alternative because most frameworks to clever and hard things to reduce the amount of work that's done in order to increase performance, and a side effect of that is using less energy.

I would debate this, the black box abstraction provided by react, et al. would probably wipe out any performance benefit.

It's all in how you write the code. I've (as an end user) muddled through tons of slow react apps, and used some highly performance vanilla js (or just "framework-less") apps.

React is not an abstraction, and to be honest the fact you are calling it that kind of makes it easy to dismiss your post here.

But you are right that it's mostly all down to how you write the code. But I'll gladly argue that it's a lot easier to write bad, inefficient UI code with vanilla JS than with React.

You don't really get to see the alternative because generally, react makes things so much easier and efficient that it opens a lot of doors and allows companies to go crazy with features and bloat. By being the beast it is, it puts a lot of power in the hands of developers, but equivalent UIs without react will most likely be 3 magnitudes worse. Keyword: equivalent.

Similarly, asymptotic complexity is not always an adequate approximation of energy consumption.

More code leads to more cache misses. More code leads to more energy consumed transmitting that data over the internet, and wireless radios are energy-expensive. More code leads to more time parsing, compiling, optimizing, and then JITing code, which can utterly dominate actual runtime energy cost if the program is not long-lived - which describes a lot of webpages.

Finally, very few webpages actually need to even be a "moderately complex React/Vue/Svelte app" - the essential complexity to the task being done is low, and webdevs add extra, unnecessary features for very poor reasons (showing off?). Take https://nabeelqu.co/understanding for example - 1.17M downloaded for 21K of text and two small images (one of which didn't load anyway). There's a 276K JavaScript file in there, among others - and the primary purpose of this page is to display a static document. Or, take any modern newspaper website you want - bloated with images, tracking, and JavaScript providing near-useless (and probably near-unused) features with a data-size:content-size ratio of over 100. If something is moderately complex, it would be much better as a native app in the majority of situations, which comes with significant performance improvements.

But the simplest thing to do would be return after logging 0 rather than loop thousands of times for no reason. By that I mean, the second example in my eyes is simpler.

The simplest code as you point out is often faster than the shortest.

Wait, design is the big energy hog? I find that... well, in need of some evidence and data.

I was expecting something like using serverless, or serving only static content or something.

There's just no way that "write less JavaScript" is the big needle mover compared to right sizing and scaling your fleet. Right?

Also, rather than spending two days optimizing all this, wouldn't you see much more carbon removed by spending two days planting trees?

> Wait, design is the big energy hog? I find that... well, in need of some evidence and data.

Is that a reason not to try to make things more efficient?

> There's just no way that "write less JavaScript" is the big needle mover compared to right sizing and scaling your fleet. Right?

My understanding is that it's less "write less JavaScript" and more "Don't pull in MB after MB of dependencies".

Also, that was just one of several points made by the author.

> Also, rather than spending two days optimizing all this, wouldn't you see much more carbon removed by spending two days planting trees?

Por que no los dos? As a result of the author having done so, it has now saved others who are interested in doing so time learning how.

> My understanding is that it's less "write less JavaScript" and more "Don't pull in MB after MB of dependencies".

Probably good practice regardless. Recently saw a project with 23,000 lines of CSS thanks to pulling in library after library. That's just hard to reason about come maintenance time.

Yes, it's absolutely a reason to consider not making something more efficient. It's not free to do the things this author recommends.

Increasing efficiency has both a cost (how many hours did it take to improve this, and how much power was spent on competing to develop them) and and opportunity cost (what could we have spent those hours on instead). If the efficiency gain never repays the cost, you've actually made the system worse by making it more efficient.

There are no claims from the author about what is saved, it seems like the amount of energy spent reclaiming a small amount of energy will lately be worthwhile.

> Yes, it's absolutely a reason to consider not making something more efficient.

Let's assume a smartphone has a battery capacity of 10WH (3000mAH * 3.7v), and you're charging your phone once per day to make up for aggregate inefficiency. If retail electric is priced at $0.10 per KWH, that's 36 cents per year? On the emissions front, that's negligible.

Is it worth considering the pollution and financial costs of replacing a battery? I suspect writing more efficient software would allow batteries to last longer and manufacturing new lithium batteries is anything but easy on the environment.
It may or may not have a noticeable impact on emissions overall, I won't try to argue that.

However, at least hitting the low hanging fruit seems like a good idea.

It also depends on your scale. Optimizing javascript on my blog will probably cost more carbon to keep the laptop on while I work than it ever will processing the client JS.

The world probably doesn't need my VM running 24/7 on the other hand. My server is in Singapore and in theory that means it's running on natural gas with Singapore getting 95% of it's power from natural gas. Better than coal, but still not great.

It's fun to think about how all this software manifests in real world, it's easy to pay it no attention.

Will inefficient JavaScript increase power consumption? Will videos and images? I think so. By all means plant some trees instead, but most of us don’t. We code. And when we do, if we consider efficiency a bit then we actually might move the needle, however slightly. It all helps.
I think my argument is that thinking about efficiency at this scale actually costs more and uses more power overall.

It's like spending an extra ten dollars once to save a tenth of a penny on each future tank of gas. Yes, there are times where that trade-off makes sense, but for most folks it won't actually make things better and could make them worse.

The author doesn't have any data to suggest what the savings here are. I assume these are miniscule or even immeasurable benefits that come at a very real cost in time and resources.

So the solution is more minimalist web design? No thank you. I’m quite over stripping down websites to their basest functionality.
Theres a line of thinking that suggests the form and aesthetics of systems or products should be a result of their functionality. Highly functional websites can still be efficient. A start would be to remove all the marketing, advertising and tracking garbage attached to them and optimise from there.
Stopped reading here:

> “But Carl, some of us don’t have the luxury of building super high-performance, lightweight, and optimised sites due to client budgets and deadlines.” Well, I think you need to work on your craft, change your attitude and your priorities, or find another profession.

He may have a valid point, but I’ll never find out as this attitude has turned me off finishing the article.

Stop using javascript. Stop using CSS or color. Don't put any images in the document that are not important to the content.
Color is actually relevant. Dark mode can save a lot of energy on OLED screens.
Yeah so make everything white on black.
Color should be dictated by the users browser, not by the website author, if the user wishes a dark background with light-grey text, they can configure their browser to display webpages with such a color scheme :)
One thing that I struggle with, as someone who is not a policy maker, is understanding the proportion of carbon emissions associated with different activities, for example, what would be the carbon emissions savings of these different options:

- The yearly energy savings of optimizing millions of web pages to reduce server side and local energy consumption?

- Banning personal vehicle diesel engines for 12 Months?

- Not shipping tonnes of tropical food across the Oceans for 12 months?

- Everybody not buying new clothes for 12 Months?

- Everybody not buying a new electronic device for 12 months?

I am not claiming that we should all go amish and bankrupt entire sections of the economy, my point is, these are all direct ways to curb carbon emissions but I have no intuition of how big of a dent in the overall emissions each option would make.

What are the carbon emissions that, if curbed, would provide the most bang for buck if you will?

And also don't forget to include Carbon emission emitted by natural event such as volcano eruptions
I think we should create a carbon/pollution tax and let the invisible hand of the market figure that out - it's too complex and there are so many side effects to adjusting things by brute force!
A carbon tax implemented by a "world dictator" would work.

Any individual country implementing a carbon tax doesn't work because they put themselves at a big disadvantage, and goods and services go across country borders, taking with them almost-impossible to fairly calculate amounts of carbon.

The biggest things the world could do towards the "world dictator" approach would be:

* Have a consortium of countries implement a carbon tax, while taxing all inbound goods from countries that don't tax carbon.

* Adjust WTO rules to allow taxing imports based on estimated carbon content.

* Have the WTO decide which countries are "on track to meet carbon reduction targets". Allow taxes on imports from any country that isn't.

* Allow countries to "sue" another country for environmental damages. When they don't pay up, have a UN court able to threaten anything up to military action/takeover of the country's leadership to get payment.

Problem is free trade & WHO itself, it is easier to go back to tariffs, by making things more expensive people will consume less, you can also increase quality & add requirements that a product must reparable.
You really only need the US to implement it as they're the consumer kings of the world. You can't just go sell a million SUV's to the Russians or Europeans or Ethiopians because you didn't want to pay the carbon tax in the US.
Does that actually work?

I would think the invisible hand of the market would re-route all that pollution to areas without the tax and the earth wouldn't see that much difference. It's not like they're going to stop selling oil if the EU and US agree to stop burning so much of it.

I agree it's complex, but I think carbon taxes might be part of the complexity. If we're going to start messing about with markets, we should outright ban the offending activity and regulate harshly. If we're going to apply tokenomics to the problem and pretend we fixed it until we're too old to care, that seems worse somehow.

Or we can just do nothing and hope technology saves us. That's what the actual bet is whether we like it or not.

You can apply such a tax in various ways. If the company resides in the US, directly tax the company. If they are importing, tax the imported goods.

The worst thing that could happen would be some 'world dictator' making universal rules because then large companies could lobby one entity to shift the rules in their favor, and against ours.

> The worst thing that could happen would be some 'world dictator' making universal rules

Surely the worst thing would be to set up a Prisoners Dilemma trap where individual countries have a huge incentive to betray all the other countries by abandoning this tax and attracting all the large companies in the world to come and pollute there.

I'm not particularly concerned about a prisoner dillemma trap.

If one country did that, the immediate response from all other countries could simply be 'stop all trade with that country' or simply 'crank up the import taxes from them' until they shape up.

You also don't need anywhere near 100% agreement for this to be effective. A large company losing just a few key markets (US, Germany, UK, blah) could massively outweigh any benefit they could imagine by trying to game such a system.

Just look at how much bs China is making the biggest corporations in the world jump through to be able to do commerce there. And what do the companies do - they adapt and grovel to get to that market. This is just one of those hyper-capitalist talking points that has never been proven true but keeps coming back up. If you do X then all the companies will leave. Like there are infinite other Chinas or Americas out there.
We do know that when the price of oil goes up people buy smaller and more economical cars and when it goes down they do the opposite.

If the market re-routed around that by building electric cars for instance then isn't that exactly what we want?

The nice thing about fossil fuels is it's fairly easy to identify and tax extraction. The problem is those industries will fight tooth and nail against any attempt to tax them.

On the other hand I do wonder what happens if carbon taxes become a substantial proportion of government revenues. Then there could be a tension between raising revenue and reducing consumption.

There are very reasonable legislative proposals for a carbon tax (most preferably a "fee-and-dividend" [1]) which apply border adjustments to imported goods based on their carbon footprint.

This prevents the tax from simply causing the production of the goods to move overseas, and also encourages your country's trade partners to adopt a carbon tax themselves (so they'll be exempt from the carbon tariff).

Such a policy is not attempting to distort the market so much as simply price in an externality that is currently causing the market to perform poorly. It says simply that, while I am still allowed to hop on a 3000-mile flight to visit San Fransisco for the weekend, I need to compensate you and your family (and everyone else in the country) for the associated damages.

On the other hand, because human civilization is so complex, outright bans and strict regulations on emissive activity are inevitably going to be ham-handed and will either be ineffectual or else too onerous to be politically viable in a democracy.

[1] https://energyinnovationact.org/

> apply border adjustments to imported goods based on their carbon footprint

The original question was how to find out the carbon footprint of goods.

That is true. But finding out those numbers is a much bigger problem for you or I than it is for a national government that can dedicate full-time research staff to producing sensible estimates.

So a benefit of this policy is that environmentally conscious private citizens no longer need to feebly grapple with such questions. You and I just optimize for personal expense and our own happiness while computing the carbon footprints of various things is the responsibility of institutions that actually have the resources to do it.

If a company is trying to obfuscate you could just have a high base rate you apply to them until they pass an audit to prove that they have an actually low footprint.
The closest thing to a carbon tax is the current system of carbon emissions trading. Which has it's fair share of criticisms as well:

https://en.wikipedia.org/wiki/Carbon_emission_trading https://en.wikipedia.org/wiki/Carbon_emission_trading#Critic... https://en.wikipedia.org/wiki/Criticism_of_the_Kyoto_Protoco...

Carbon emissions trading does have an impact on carbon emissions, but it also detracts from the fundamental issue at hand - overreliance on fossil fuels in key industries and the need for a fundamental shift in our infrastructure in how energy is produced/consumed - while the costs, ultimately, get deferred elsewhere e.g. individual consumers.

Measuring the effect of any tax is difficult, especially if it is hypothetical or only existed for 2 years, but Australia’s experience suggests that carbon taxes work (ie. they reduce carbon emissions). The biggest taxpayers were aluminium smelters, and the resources industry isn’t that mobile. https://en.wikipedia.org/wiki/Carbon_pricing_in_Australia
The invisible hand is severely tied though.
I like the elegance, but am growing to believe voters are simply unwilling to implement it. Mainly because "taxes" are eternally unpopular. It's possible that the best solution is actually the most implementable solution, rather than the most optimal solution.
I am also curious about this. I heard that something like one trans-Atlantic flight is worth 2 years of veganism. And that 10 or so freight ships produce as much pollution as the whole of Europe. These are vague statements, and the reality is certainly more nuanced, but it would be nice to have a sense for what the big issues are. For example: Would giving up coffee, with its links to deforestation, be tremendously beneficial or only marginally?
"And that 10 or so freight ships produce as much pollution as the whole of Europe."

This one is highly misleading. They may produce some very specific pollution more than entire Europe together, but pollution overall will be clearly lower.

Emissions of just C02 is about 4000 megatonnes in just EU ( https://en.wikipedia.org/wiki/List_of_countries_by_carbon_di... )

4000 / 10 / 365 = 1.1 megatone per day.

I am not expert on ships, but emitting 1 100 000 000 t of C02 per day seems unlikely.

As always, it's complex.

Most freight ships will burn marine fuels such a 'bunker fuel' when they are offshore not near ports, largely due to the health risk of increased PM in the air near ports.

The issue with fuels as unrefined as 'bunker fuel' (the thing is practically crude) is that they emmit a really high concentration of other gas other than CO2, namely SO2 and NO2.

> "SO2 shipping emissions are projected to increase and by 2020 exceed SO2 emissions from all land-based sources such as power plants in the EU, which over the past several decades have been reduced dramatically at great cost to industry." [0]

CO2 is obviously our major pollutant but Sulphur dioxide (SO2) is a major green-house gas contributor. The frustrating thing about bunker fuel is that it is used offshore purely because it is cheaper and there is no regulation curbing it. As with almost all things environmental related we go back to the hidden long-term costs of having something cheap in the short-term.

[0]https://www.transportenvironment.org/publications/sulphur-ma...

> CO2 is obviously our major pollutant but Sulphur dioxide (SO2) is a major green-house gas contributor.

SO2 appears to actually have a negative greenhouse gas effect: https://www.carbonbrief.org/sulfur-emissions-may-have-slowed...

> SO2 appears to actually have a negative greenhouse gas effect

You make it sound more factual than it is, it's a computer model projection.

From the same paper you linked:

> "Although the new paper acknowledges the that the slow-down could be a result of natural variability in the climate system"

Which is currently the consensus agreement on this.

Bunker fuel is what's left after crude oil has had all the lighter fractions cracked off:

Small molecules like those in propane, naphtha, gasoline for cars, and jet fuel have relatively low boiling points, and they are removed at the start of the fractional distillation process. Heavier petroleum products like diesel fuel and lubricating oil are much less volatile and distill out more slowly, while bunker oil is literally the bottom of the barrel; in oil distilling, the only things denser than bunker fuel are carbon black feedstock and bituminous residue (asphalt), which is used for paving roads and sealing roofs.

https://en.wikipedia.org/wiki/Fuel_oil

thought note that "Shipping emissions in total emit more SO2 that all power plants in EU" is drastically different than "10 largest ships pollute more than entire Europe"

And yes, something should be done with pollution generated by shipping industry. Though I wonder what else you can do with bunker fuel. Store it?

Oblique mention of Project Drawdown that tries to tackle such questions (albeit at a slightly more abstract level) methodically [1]

[1] https://drawdown.org/

Heating, cooling, and transportation probably dominate your personal carbon footprint.
What about eating meat?
By removing meat more people would starve. Now that can be a good thing because fewer people means less energy consumption, however you still need to make that moral argument that starvation is an acceptable solution for reducing energy consumption.
I've missed something. If I stop eating meat then people will starve? Are you talking about the meat farmers?
I’m talking about that the society as a whole will produce less food if we all would go vegan.
It would be a big change for sure, but maybe less of a problem than you imagine:

https://ourworldindata.org/grapher/share-of-calories-from-an...

Also there's the fact that, per calorie, producing beef requires an order of magnitude more arable land than producing <insert-your-favorite-vegetable-here>, since cattle eat so much more than humans do.

Only a small percentage of US beef production is grass fed and worldwide grazing systems supply about 9 percent of the world's production of beef, the rest are crop fed in addition!

https://news.cornell.edu/stories/1997/08/us-could-feed-800-m...

https://iopscience.iop.org/article/10.1088/1748-9326/aad401

The real killer is beef. Simply replacing beef with almost anything else will have huge impacts (see page by FAO). If elimination is too much of an effort to make for our kids, doing it n% of the time will still bring n% improvements.

I might add that the generation of my parents (born in the 40's) ate meat once or twice a week, at least during the 40's and 50's, and they turned out fine.

http://www.fao.org/gleam/results/en/

The thing is that soil used for grazing cattle can’t be used for planting vegetables efficiently.

There is a reason why we have different farming, because of different soil quality.

So the effect would be to reduce the area of where we can produce food.

And if you would remove cattle you no longer have natural fertilizer. Mineral fertilizer has a big environmental impact on ground water.

> The thing is that soil used for grazing cattle can’t be used for planting vegetables efficiently.

This is true, but it's not how modern meat is produced. A lot of high-quality land is used to produce meat that could be used to produce vegan food, no?

I wouldn't be surprised, but do you have any statistics?
(This may be a good place for me to clear some misconceptions I have about farming; treat this comment as an application of Cunningham's Law.)

> The thing is that soil used for grazing cattle can’t be used for planting vegetables efficiently.

Not planting vegetables efficiently != not planting them at all, right? Could the lower yield on such fields still come ahead of lower energy efficiency of meat (in terms of energy expended per calorie of final human food produced)?

> So the effect would be to reduce the area of where we can produce food.

Surely we can grow something human-edible there. Or could perhaps this land become earmarked for construction, while equivalent amount of very fertile land could be switched from construction to farming? AFAIK there's plenty of settlements built on land that would be better used for farming.

> And if you would remove cattle you no longer have natural fertilizer.

Is industrialized agriculture even using natural fertilizer? I was under impression modern fertilizers are made in chemical plants and their production doesn't involve animal excrement.

If it is not efficient it will cost more than it yields, a loss. According to FAO 70% of worlds land surface is not suitable for planting crops.

Cattle can transform grass, that we can't eat, to protein that we need. It is actually a good thing, especially if you can't grow anything there.

In Sweden we have something called ecological farming, it is certification, to be approved for ecological farming you can't use mineral fertilizers anywhere in your food production.

Ecological products are usually somewhat more expensive in the store.

Now there are of course lots of farms that is not classified as ecological and they can use mineral fertilizers or natural fertilizers.

About a third of all fertilizers for farming used in Sweden is natural.

Thank you for the answers!

> If it is not efficient it will cost more than it yields, a loss.

I was thinking about less efficient, but still profitable. I presume it's not a binary, and farms aren't operating barely above EROI of 1.

> According to FAO 70% of worlds land surface is not suitable for planting crops.

That's... super surprising to me. I would have expected something closer to 50-40%. Perhaps it hinges on the definition of "suitability"? I'll look into those stats.

> About a third of all fertilizers for farming used in Sweden is natural.

That's also surprising to me. Is this number so large because there are so many ecological farms in Sweden, or natural fertilizer is just so popular?

Sure, it is perhaps possible for planting crops in areas that is less suitable, I guess that the current economic system we have in the West makes that not feasible. That is why I'm in favor of tariffs on imported goods.

With more being produced within your country you can legislate higher requirements on production methods. And when food becomes more expensive to buy, the incentive to have high quality production increases.

In the west we no longer have the problem of food shortage, thus we can afford somewhat higher food prices. And of course if you produce more within your country, you can get better salaries.

Why Sweden uses that much natural fertilizer I can't really tell.

But I found something about high prices on synthetic (mineral or others like natural gas) fertilizers. This was something that started happening globally around 2008. Between September 2007 and September 2008 prices increased with 80 percent globally.

If you understand Swedish, 2008

https://www2.jordbruksverket.se/webdav/files/SJV/trycksaker/...

You really think your restaurant and supermarket beef is coming from grazing? Those cattle live in dense feedlots, where they are fed corn and soy.
Where I live (Sweden), yes actually, but I do understand that US are somewhat crazy.

Isn't corn production massively subsidized in the US? So it becomes cheaper to feed cattle with corn instead of grazing. Madness.

That type of meat production is not something I support.

Did some googling. The US is the #2 beef exporter, and Sweden is not in the top 15. Admittedly that doesn't necessarily tell me about domestic consumption.

http://www.worldstopexports.com/top-beef-exporting-countries...

Interestingly, the #1 exporter, Australia, has historically used a mix of grazing and feed grains. But they're expecting to grow more feed grains because grazing suffers during droughts, which are increasingly common. Apparently those grains are wheat and barley; corn is definitely an American obsession. I assume that will be grown on land that could otherwise be used to grow food for humans.

https://www.beefcentral.com/lotfeeding/grain-sector-faces-ne...

Nutritional and greenhouse gas impacts of removing animals from US agriculture

https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5715743/

In the simulated system with no animals, estimated agricultural GHG decreased (28%), but did not fully counterbalance the animal contribution of GHG (49% in this model). This assessment suggests that removing animals from US agriculture would reduce agricultural GHG emissions, but would also create a food supply incapable of supporting the US population’s nutritional requirements.

Assuming agricultural emissions account for 9% of total US emissions (47), and assuming that emission estimates here are representative of national emissions, eliminating animal agriculture would decrease total US emissions by an estimated 2.6 percentage units.

The cost of things gives you a reasonable idea of the environmental impact. Energy intensive products and services have to pay for all that fuel.

This is why cities produce more CO2 than rural areas. Potentially it is more efficient to live in a city but city dwellers are richer and hence spend and consume more.

I went to a talk by the economist Jeffrey Sachs a few years ago where he said the sustainable level of spending around the world was about $10K USD PPP. Not much room for a Tesla in that budget.

Yeah no estimate is available for this as of now.

But developers continue to write inefficient code even if other consequences are obvious:

* If using cloud, often inefficient software will lead to higher expenses than developer time.

* On mobile devices battery life is important

* On mobile networks bundle sizes matter

Barring biases for the outlet itself for a moment, Vox did a pretty good video on this issue within the context of electricity consumption.

https://www.vox.com/2020/9/10/21430916/2020-presidential-ele...

Even policy makers struggle with this. It's very hard to make a comprehensive, understandable model that connects all the dots across the board. So, that's what this piece is about.

And here's the actual graph from the video:

http://energyliteracy.com/

The argument presented here isn't to reduce consumption - although, in absolute terms, that directly impacts carbon emissions - but to strategically replace fossil fuel sources for clean energy (solar, wind, water,...). It's an interesting perspective because it avoids turning the discussion about "consumption reduction" into a debate about token use cases such as "millions of web pages need to consume less energy."

To put it more succinctly, it's more interesting to consider the origin of the electricity coming out of the socket in a datacenter or housing then how it gets used by hardware plugged into those sockets.

I'll give you a for instance. Suppose you have to pick a host for your personal website and you're mindful about energy consumption. So, you're considering Digital Ocean: What type of energy is powering their datacenters? Turns out they don't really communicate about that, but intrepid users have figured it out (data februari 2020):

https://www.digitalocean.com/community/questions/what-kind-o...

So, if you choose NYC1 as your region when you pick a droplet, that's assumed to be powered by 100% wind energy.

Same with people who visit your website. Suppose, in some utopian way, 100% of your visitors have solar, batteries and are off the grid, then their daily visits to your website will have a reduced impact as well. Why reduced and not net-zero? Because the intermediate network infrastructure between NYC1 and, say, a visitor living in California, needs to be powered as well and there's no guarantee traffic won't be handled by fossil fuel powered network nodes at this point in time.

Diesel cars have significantly lower carbon emissions than petrol cars and even than some electric car usage when accounting for the energy production. Diesels are even the best placed to run on biofuels.

Why single them out?

The issue with diesel engines is the fuel does not burn as cleanly in terms of particulate matter. Biodiesel and dinosaur diesel are both the same in this. For the last 15 years or so new diesel cars in Europe have been required to have a diesel particulate filter with the aim of reducing this.

Unlike a catalytic converter though, eventually (after 150,000km or so) they will become blocked up and cause a noticeable drop in power or cause engine fault codes. At that point you need to replace it, which could be a few thousand Euro for a new DPF, or the more common option is to remove it. This is illegal in most EU countries, but also a blind eye is turned to it - even in places with strict emissions checks like the UK.

AdBlue is a modern way of reducing this even more, but there are already devices you can buy that will trick the ECU into thinking your tank of AdBlue is full when its actually empty.

Combined with other common issues like injectors wearing out, as a diesel engine gets old it will burn fuel a lot dirtier than a similar aged petrol engine.

None of that has anything to do with carbon emissions, which do not increase with poor maintenance (unlike NOx or particulates). And they're all manageable issues, unlike the carbon emissions of petrol engines.
That's true, but diesel engines are only really less polluting in terms of CO2 due to using a lower amount of fuel consumed. If your goal is to reduce that, then as you say biofuels are the right answer.

However any mass adoption to biofuels would require different engine (existing engines will work fine on a low blend of biofuels, but very few will work on 10P%). For cars, why would you stick with a biodiesel engine which is more complicated and has higher levels of other pollutants, than some sort of biogasoline engine?

Engines running on biofuels equivalent to benzine are still significantly less efficient than diesels. They also require significant modifications, whereas diesels run on vegetable oils with little to no change.

Hemp oil powering diesels is possibly the most efficient locomotion path we have, only really competing with electricity generated with little carbon emissions.

> Banning personal vehicle diesel engines

Diesel is not worse than petrol:

Diesel cars tend to have lower volumetric fuel consumption figures than comparable gasoline vehicles. However, the benefit in terms of CO2 emissions is significantly lower, as the combustion of 1 liter of diesel fuel releases approximately 13% more CO2 than for the same amount of gasoline.

> the combustion of 1 liter of diesel fuel releases approximately 13% more CO2 than for the same amount of gasoline

But with a liter of diesel (usually) you can make more kms than with a liter of gasoline. I'm not sure the CO2/km of each class of motor, though

imho both effects stem mostly from the fact that diesel has ~11% higher density than gasoline.

(ie. mileage and co2-output become more equal if measured against mass rather than volume)

I believe the issue with diesel is NO2, basically it may emit less but it's worse for us

https://www.theengineer.co.uk/fact-check-are-diesel-cars-rea...

> ..it's worse for us

Is diesel CO2+NO2 is worse than petrol CO2+NO2 for global warming?

Potentially Diesel has less CO2 emissions than Petrol if that is the point you want to insist on.

The major issue with Diesel is NO2 emissions, on top of respiratory issues directly attributed to NO2 in city centres, NO2 is also a reducer of human longevity. [0]

I would say anything that is slowly killing us and reducing our lifespan should be pretty high on our priorities list.

[0] https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6801524/?report...

"Web professionals" - therein lies part of the problem: to turn a simple mechanism for self-publishing into an idiosyncratic ever-changing self-serving cottage industry.
Use CDNs for delivering JavaScript libraries instead of including everything into custom bundles.

React could be transferred ONCE to the browser-cache instead of hundreds of times.

This isn't effective as browsers partition the cache using a double (or triple) key of the document origin and third-part origin.

Safari started this and Chrome is following - https://andydavies.me/blog/2018/09/06/safari-caching-and-3rd...

So with a public JS CDN React would be still transferred multiple times.

Using a custom bundle is probably more efficient as it should compress better resulting in lower download sizes (bit often modern bundles are huge so I wouldn't rely on this point)

IMHO it's the wrong problem to fix. My view is that the best way to speed up the transition to clean energy is to vastly increase demand for electricity. This causes people to invest in new energy production. Which at this point pretty much means more wind and solar gets added. The more we have of it the less important remaining coal and gas plants are. Many countries are nearly done shutting down their coal plants. Gas plants are still being built but the economics for that are also not looking great at this point. Once we have a robust clean energy grid, these will probably be mothballed as well.

Data centers are already mostly running on clean energy and in so far they are not, all big cloud providers have committed to being carbon neutral. So, if you have some solar on your roof, you basically could be browsing the web without expending any carbon. So, open some more tabs and stop worrying.

In any case, the web is a tiny portion of our overall energy consumption so it's not really worth prioritizing this for optimization. Best case, it won't make a lot of difference. Worst case you are sacrificing design and UX for something that ultimately doesn't matter in terms of tangible results.

Of course, there's nothing wrong with making laptop batteries last longer, making laptops run cooler, and delivering a web site that is fast and responsive.

This is a mild example of a type of argument that I like to call "destructionist": to save something, destroy it as fast as possible so we have to deal with the consequences sooner. I've seen it applied to climate change: save the earth by ruining it!

It's fallacious, though. If you can save it later, you can save it sooner, and if it's worth saving at all, sooner is better. It's not an argument for a _solution_, it's an argument for _finding the will to implement the solution_ -- and it's the "minimally moral" argument for that. "Rather than do anything that takes moral strength, just make the problem worse and let other people deal with it!" The only worse stance is to no longer want a solution at all!

Of course it does seem like the real problem isn't figuring out what to do, but convincing people to care enough to do it. But our collective human intellect ought be able to do better than this.

It's an economic argument; you are making a moralistic argument. Economics have achieved more in the last five years than decades of moral outrage over climate change.

I'm simply stating that increased demand for energy is currently being met (almost exclusively) through clean energy. Speeding that process up through more demand (which we have anyway) also speeds up the process of shutting down dirty capacity.

This is why coal is rapidly disappearing from most countries still operating coal plants. Unthinkable ten years ago, and yet nearly completed in some countries right now. Even the US is on a clear path to probably be completely coal free very soon.

The problem is not the demand but the dirty and expensive supply. I'm simply arguing to fix the supply problem by flooding the market with clean alternatives. The fastest way to do that is simply increase demand.

> My view is that the best way to speed up the transition to clean energy is to vastly increase demand for electricity.

No. Historically, and globally, when electricity demand increases, electricity sources stack up. We may create more clean energy that way, and that will increase the percentage of renewables in the energy mix, but the atmosphere doesn't care about percentages. It cares about how many tonnes of carbon are released by the existing electricity sources that need to be shut down.

The last thing we need is another source for more electricity demand. Electrifying transportation alone will increase demand more than enough for your dream market investment magic.

Historically we replace expensive sources of something with cheap sources of something. As demand increases we source the best/cheapest version to meet that new demand. The energy market is no different.

The vast majority of new capacity on the grid is coming from wind and solar. As the supply of clean energy increases, suppliers actually decommission and shut down more expensive existing capacity. That's why coal plants are going out of business in lots of places and why some new gas plants are not utilized at 100% and instead kept around only to address peak demand. This is enabled by a growing demand for and a supply of clean electricity at a lower price than what they can produce with legacy plants.

Countries with growing economies tend to have a growing electricity market and a shrinking proportion of dirty energy. So, KWH goes up, CO2 goes down. The number of GWH from coal in Germany has actually gone down in recent years. While gas grew a little to offset that, much more growth came from re-newables. So, the CO2 production has been going down year on year. The amount of gas consumed per year in Germany is still substantial of course but not really growing at this point.

Accelerated growth in the energy market increases the pace at which energy providers invest in new capacity. This in turn speeds up the process of de-commissioning economically non viable plants.

Electrifying transport indeed adds a couple of tens of percent but it will take quite long to get there. If you drive 10000 miles in a year, that adds about 2.5GWH to your yearly energy bill (assuming 200 miles/50kwh of battery in your car). That's ~25% of the energy usage of an average house hold (in the US). But it will take quite some time before all households have EVs. 25% growth over 2 decades is not that much. Also a lot of that demand will be met by people putting solar on their own roofs, which technically shrinks the grid demand and overall energy market.

I'm trying to find a good source, but on phones, data size isn't as much of an issue as how long you have to keep the LTE radio powered for a full data connection. The worst thing you can do is progressively load content every 60s as someone scrolls or ping back to a tracking server every 60s.
Just, put the content that needs to be there out and as little else as possible.

If downloading less (off page stuff) is important for a CLIENT device to do, it will do the lazy loading for you. If loading it or not matters the client will do so. (Anywhere that just pulls it all down is still going to do the same thing; since that's the easiest way when it doesn't matter.)

This is an important and timely call to action but I think the more important audience here is ad tech professionals. The difference between my processor fan turning on or not is frequently ad tech.
Advertising is a cancer that needs to be eradicated; it not only wastes energy but also human time.
Not the web, but abandon Bitcoin.
The amount of power dedicated to Bitcoin mining dwarfs anything just about everything else we can do as coders. It's embarrassing really.
This is true but it’s one of the sacred cows here in HN so crickets
My first step is https://concise-encoding.org

All of this constant stringification/destringification just for another machine to read some transmitted data is massively wasteful, but we all do it because we want our data to be human readable, so we use JSON. But what if you could send as binary, with the ability to convert 1:1 to/from text only when you needed a human to inspect or input the data?

What if you didn't need to encode all of your non-numeric data into strings?

I've got many other steps in the pipeline to reduce our energy wastage, but this first one has taken awhile (3 years), and I still need more eyes on it to make sure nothing gets missed before I release in a few months.

Someone cue in the appropriate xkcd about n+1 standards.
Someone cue in the tired old discussion pointing out that the standards xkcd comic was about the futility of all-encompassing standards, not an admonishment against making something better.
Protobuf?
Protobuf is solving a different problem than the JSON, BSON, XML style ad-hoc data encodings. It's also not human readable.
I'm not a huge fan of putting client-side rendering on everything, but I still feel it's unfair and shallow to put so much blame on it.

For an app getting more than a couple page views in a session, a SPA solution may provide significant savings on rendering and db queries. Combine that with resource caching and these effects extend to following sessions.

That is, of course, if the app was built with some consideration regarding overall performance. Unfortunately, not too many web developers (both FE and BE) seem to be overly concerned with efficiency.

I don't believe asset and component delivery are the energy hogs this article implies. Actual computation uses more energy. Youtube transcoding the 500 hours of video it gets every 60 seconds uses much more power than too many unoptimized PNGs do. We live in a time where people will run their car to charge their phone. It's not js packages. The inefficiencies are in the chair, the users chair.
You're right, but that doesn't mean we shouldn't do anything. If we can flip a bit somewhere to save some minute amount of energy, we should do that. For example: optimize PNGs, it's easy and a one time procedure.

We can't change what's in the chair but we can change our product.

If the effect is minute enough, you might be using more net energy thinking about this, typing this comment, discussing it with others and optimizing your final png than actual energy saved for your users.

Feel-good savings are not helpful. You can do it but let's not pretend. Reminds me of an ex girlfriend that would account for coins she found on the ground in her monthly budget...

> Reminds me of an ex girlfriend that would account for coins she found on the ground in her monthly budget...

Where do you find enough coins on the ground for that? I haven't come across any in my entire life.

You don't, that was kinda my point :) she'd find maybe 1 eur a month if lucky.
I assume they mean minute relative to cars or something, not minute in an absolute sense.

Just as a sort of thought about this, if the entire web moved to brotli over gzip, or if we introduced an even better compression algorithm that was widely distributed across the internet, what would that impact me? A 5% reduction in CPU usage for every computer loading every page? I'd be curious to hear what that would actually amount to, power-wise.

I might be cynical, but that change would work only with the assumption that what is done on the page remains constant. What I guess would happen is that it would do 5% more useless operations. The limiting factor here is user's tolerance for bullshit, not some predefined functionality.
I get your point and I agree to some extend -- a single png doesn't remove much carbon. But it's impossible to figure out where the break even point lies. It would be irresponsible to never optimize for size or cpu usage. Where would you draw the line?
Do some napkin calculations so you get a ballpark of where the line is. That will help you discard entire categories of pointless optimizations (e.g. pictures going into a company-wide email for a 500 person company).
It depends on scale. I’m working on a site with multiple billion visits a year, so optimising a global asset will absolutely have an effect.
Eh, why waste time on that when major polluters are oil, meat, packaged fast food etc.

Look up Saudi Aramco, Chevron, Gasprom, Exxon, Coca Cola, Nestle, Bayer, JBS, Tyson etc. Many of them are owned by investors. Why can't we punish investors which are very few compared to the number of web developers out there?

We all have a role to play in the fight against climate change. It doesn't help pointing the finger at another group of people and say that it's all their fault and that they have to fix it.

It's like with taxing the wealthy. Everybody agrees the wealthier part of the population should be taxed more, but no one considers himself wealthy enough to fall in that category.

> We all have a role to play in the fight against climate change.

Yes. That's why I am proposing a real solution compared to relying on billions of people changing their habits which are intentionally forced on them by the environment.

> It's like with taxing the wealthy. Everybody agrees the wealthier part of the population should be taxed more, but no one considers himself wealthy enough to fall in that category.

Not comparable. Everyone who invests in companies that harm the environment get taxed heavily on their investment to offset the carbon emissions. There is no subjective wealth factor here.

Maybe your hands are clean, but I'd wager most of us are customers of the companies in that list and we benefit from their behavior. Why blame the investors and not the customers?
Most of the consumers have little choice in their consumption. Investors who are putting millions of dollars knowingly into companies that harm the environment are doing it intentionally. There is no comparison here.

It's easy to change thousands/hundreds of investors responsible for these companies than billions of consumers.

We have tried putting responsibility on consumers and it utterly failed. 90% of plastic isn't recycled. Many companies which promised to take your blue bin and recycle it sent it to China and other Asian countries. Repairability has only gone down.

> For example: optimize PNGs, it's easy and a one time procedure.

And then that PNG is loaded by a webpage, which contains no HTML, but loads 28 megabytes of JS, which your browser has to parse, JIT and run, and then that triggers loading of web-fonts, and after that we create a virtual DOM, and then render that into a real DOM... (which is probably around 150kb)

And then after about 15 seconds of 100% CPU time, the browser finally has something to show... And then it loads that minified PNG.

You know what? That PNG isn't the issue. That PNG probably has a highly optimized decoder, written in native code, and the relative cost of a optimized/unoptimized PNG in this case is probably 0.0001% of the total energy we just spent getting and rendering that page, a page which more often than not contains basically static content.

If that page instead:

1. had been plain, pre-rendered HTML

2. had no JS, except if needed.

3. had no web-fonts, because the user already has 2000 fonts installed. (And you want to be green, right?)

4. And finally had that PNG.

Then optimizing that PNG would actually have an impact. On most sites today though? Not a chance in a hell.

Also: that page would render in a nano-second, so it's not just a greenification, it's an actual real world performance-optimization too.

The savings made by a single png doesn't change in this scenario, it just drowns. One thing you can do: optimize pngs. Another thing you can do: optimize js. Focusing on the largest sinner first makes some sense, but doesn't change the fact that optimizing a png will certainly save the whales.
Voted straight to the top an opposing view that makes a single woolly and unjustified claim ("Youtube transcoding the 500 hours of video it gets every 60 seconds[0] uses much more power than too many unoptimized PNGs do" - but no figures to back either of those claims up). I see a lot of that on HN, strange thing.

I run without JS. If I need JS I start up a VM. It's quite common for eg. google groups to max out the CPU for 10 seconds or more before updating. This is where your problem is. A 100 million CPUs permanently at 100% is where your energy is going.

[0] I found this stat backed up here (https://www.brandwatch.com/blog/youtube-stats/) You should post this fact to stop other people wasting their time.

From the above:

Over half of YouTube users use the site to work out how to do things they’ve not done before

This is one of the undersung advances of the web - it's become more than access to the worlds knowledge (like some uber library) but has become a new means of transmitting learning.

On the other side if one could workout a way to identify a product related to this "new thing to learn" the retargetting value would be huge

> Youtube transcoding the 500 hours of video it gets every 60 seconds uses much more power than too many unoptimized PNGs do

Youtube encodes the video only once, users decode them billions of times in their laptops/phones

Plus datacenters have an incentive to be energy efficient and are becoming more and more green.

Don’t forget most videos see very few to no views (private/unlisted and people are mostly boring)l
That has a negligible impact on the ratio of <view time> / <encoding time>
> Youtube encodes the video only once

My assumption always has been that Youtube is creating multiple renditions of videos at different resolutions and codecs.

(comment deleted)
Pretty sure the GP meant only once for the encoding of each resolution. He was just pointing out the asymmetry of the work, YT only encodes once per distinct resolution it shows, each of these encodings can be decoded by clients millions of times if the video is popular enough to bring in that many clients.
> The inefficiencies are in the chair, the users chair.

If that is the case, then optimize for the user so they aren't running their car to charge their phone as often (or other such craziness).

My biggest problem with the article is the failure to quantify the energy use of these optimizations. Sure, it is difficult to do since there are so many variables and most of those variables are difficult to generalize. On the other hand, it should be possible to come up with relative measures to facilitate the optimization process. For example: when is it better to do something on the server vs. on the client? When will the decision even matter?

Of course, the suggestions offered by the article are also varied in quality. Some clearly offer better energy efficiency for both parties, such as not adding elements that you do not need. Others may indirectly benefit both parties: doing more server side processing on a popular website is going to benefit the consumer, but it also forces the provider to consider the cost of added overhead. Some simply have questionable merit, such as optimizing the size of resources that are infrequently used. Others are of dubious merit, such as the tendency of SEO to be used to find the provider's content rather than what the consumer needs.

It is a much more complex issue than can be addressed from a few quick tips.

> The inefficiencies are in the chair, the users chair.

PEBCAK[0]

Personally, I still like to optimize my pages. I learned Web design, at a time when pages were supposed to be about 50KB, or less. That seems quaint, these days.

I use a lot of GIF and PNG8 images, and use CSS gradients and effects. I’ll do things like make a rollover image as a GIF in two parts, and use CSS to move the background image. Makes for a zippy rollover.

But I’m still beholden to my site framework or theme, loading 1MB of useless JS and CSS for every page. Some of the new site builders, using things like Jekyll, are nice, but take more time for me (I am not actually a Web designer, although I have written many, many Web sites).

As noted, the real hogs are on the big iron. We can write software and APIs to reduce CPU usage, but it’s a drop in the bucket, compared to the server. I think that server engineers are already doing everything they can to be efficient; simply because that confers a competitive advantage.

But, also as noted, as long as there’s a vast demand for cat videos, there will exist, a vast cat video delivery infrastructure.

[0] https://en.m.wiktionary.org/wiki/PEBCAK

Big G prefers to send VP8/9 to save on bandwith costs. This externalises costs to users since only the newest SOCs decode in hardware. If you wanna save energy you have to use the h264ify browser extension.
This article is the software version of telling people to reduce their carbon footprint, when the be 15 biggest ships produce more pollution than all cars combined.

I mean the articles not wrong, we should try and reduce the energy we use. But at the same time there's much more efficient ways to do so.

> "From data centres to transmission networks to the devices that we hold in our hands, it is all consuming electricity, and in turn producing carbon emissions. According to recent estimates, the entire network already consumes 10% of global electricity production, with data traffic doubling roughly every two years."

That's interesting. It's more than I would have guessed. I assume that's dominated by the energy used by data centers and whatever devices the users are using, and that all the switches in between are relatively cheap to run relative to how much they're used?

Anyways, my suggestion is the obvious one: turn off all that ad and tracking nonsense. That's incompatible with the business model of a lot of popular sites, though. A good fallback may be to encourage everyone to use ad-blockers.

Quite simply by becoming web professionals in the first place.

All of the inefficiency examples create unnecessary cost or worsen the user experience. It's well documented that most people work better and more often with fast tools. And there's lots of regular folks complaining that fashionable hipster websites are horrible to use. And lastly, lots of Javascript also increases maintenance costs.

So all of the points could be summarized as "don't make user hostile beginners' mistakes"

Now the more important question is: which company actually values its users / customers enough so that they won't outsource to the lowest bidder?

Once upon a time Google cared a lot about performance of client facing application.
Yes, this. All of the issues raised end up costing money and dollars are a great proxy for energy efficiency.

If you can shave x$/month from the infrastructure budget, wether it's servers or bandwith, you are being greener.

Is it like a competition in sarcasm here?
For the backend, stop using Php, Python, Ruby and start using Java, Rust, or C++.
Sometimes I recycle tabs instead of opening a new one :)
Working from home would likely have a greater impact than anything else listed here.

If I'm not mistaken, the internet uses as much power as all of Germany, or less than 100 million people. This makes our choices as individuals more important than our choices as developers.

Drive less, fly less, consume less.

It's less about the web and more about the computations we're running. The stack end-to-end is inefficient because software quality is lackluster and deficient of craftsmanship. This is mostly because the hardware enabled this type of behavior.

The only way this is going to change is to change the hardware. I see this becoming possible as we transition to localized manufacturing where the individual only depends on themselves.

So as we get closer to chip fab happening via a 3d printer, and all hardware and software being local, we'll be closer to the energy efficiency goal.

You can see the trajectory already happening and IoT/Microcontroller/Etc boom. Lots of cool new projects are coming out with the "hacker-like" culture of old on energy efficient chips that can run amazing software powered by just solar alone.

Super cool, I have faith we'll get there soon!

"entire network already consumes 10% of global electricity production" - [citation needed].

I keep encountering blatantly wrong claims like "10 largest ships pollute more than entire Europe" or "unplugging unused chargers is important" or "there is no global warming" or "global warming threatens extinction of Homo Sapiens" so often that I stopped treating such claims seriously, unless there are proper verifiable nonpaywalled citations.

It is a hard topic, as it will depend on things like life-cycle analysis of network devices, but if you google a bit, all reports are in the 7-12% range.

Around 10% of the world’s total electricity consumption is being used by the internet, according to a recent research report from Swedish KTH. [https://insidescandinavianbusiness.com/article.php?id=356]

Our best-case analysis shows a decline in consumption from 7.4% in 2012 to 6.9% of total global electricity consumption in 2017; however the worst-case shows a rise to 12.0% driven primarily by expansion of the network and data-center infrastructure. [https://aran.library.nuigalway.ie/xmlui/handle/10379/3563]

See figure (ICT electricity usage 2000kWh).[https://www.nature.com/articles/d41586-018-06610-y]

Very interesting. I would expect it to be much lower. I wonder how much of this is wasted on cryptocurrencies.
Regarding pollution, a specific problem is where a specific pollutant is high relative to others.

For shipping, bunker fuel emissions are modest in CO2, but high in particulates and extraordinarily high in S02 emissions. You can literally visually identify major shipping lane by such emissions, as here in the Indian Ocean:

https://earth.nullschool.net/#2020/09/18/1000Z/chem/surface/...

The thing is that there's a considerable set of commonly-tracked pollutants, with emissions varying greatly by source, as wwell as markedly different long-term and wide-are effects, some large, some small.

The chargers claim ... is mostly bullshit, however.

The claims may be both clickbait (misleading) and accurate (properly qualified).