Ko-fi

Showing posts with label performance. Show all posts
Showing posts with label performance. Show all posts

Wednesday, 1 July 2026

Is your AI eco-friendly?

Back in 2019, I wrote a piece called "Is your code eco-friendly?" and dropped the #cowfart hashtag into the world as a slightly ridiculous yet memorable way to flag inefficient code during reviews.

Welcome to the 2026 version.

Same hashtag. Same spirit. Same desperate hope that a daft label might make people pause for a second and do better. We are simply extending that exact same call-out to the prompts we fire at models living in distant, glowing halls full of silicon. The underlying principle has not changed; only the thing we are now rendering horribly inefficient has changed.

Do you realise that sloppy prompting is a direct contributor to global warming?

Although I have absolutely no data to base this on, please, read on. I assure you that you will not only conclude that this is a true statement; if you use these generative tools every day, you may even feel compelled to tighten things up a little. If that is not enough of a hook, I will encourage you to use this hashtag when you spot blatant waste in your own prompts or in someone else's shared experiments:

#cowfart

Let me set the scene...

There is an awful lot of AI out there, humming away in data centres across the globe, and sadly, a massive chunk of that usage is not optimised.

Back in the day when we wrote in assembler on tiny 8-bit computers, we would obsessively count clock cycles (honestly; it wasn't just me!) and refactor, refactor, refactor... until we squeezed every single ounce of oomph out of the CPU.

As computing power exploded, that discipline dissolved. The industry stopped optimizing code and simply relied on faster hardware to hide sloppy architecture. When the generative AI revolution arrived, we imported that exact same wasteful mindset wholesale. Instead of crafting tight logic, we began throwing gargantuan language models at basic tasks. Hardware got incredibly fast and cheap, so efficiency was discarded in favour of pure convenience. Fire off a lazy prompt. Get something back. If it is not quite right, just fire another one. The massive cloud servers will sort it out.

It really was that simple for years.

Chat about absolute nonsense. Generate an image of a cat wearing a tiny hat. Draft an email that sounds almost human. In the corporate world, letting things consume a few extra thousand tokens was never viewed as a problem; it just meant more time to idle away at the digital water cooler.

Sidenote: I would encourage every budding prompter, and even seasoned ones who have only ever known the luxury of the biggest commercial models, to try a small local setup on modest hardware. The way you learn to feel every single token, every parameter, and every watt that registers on your own electricity meter... those lessons change how you approach the big clouds forever.

Technology has moved along at a terrifying pace. Astonishingly fast. And the world has grown thoroughly accustomed to answers appearing before the thought has even finished forming inside their heads.

The plot thickens...

Thing is, we have got big problems out there.

With the climate.

Okay, not just with the climate; other catastrophic problems are readily available.

You do not have to just believe in it anymore, either. It is cold, hard fact, evidenced in the starkest possible ways.

We take a tangent...

Before we pivot back to my main point, let us look closer at that ridiculous hashtag.

I initially contemplated inventing a flashy new slogan specifically tailored for the AI era. Something filled with tech jargon felt tempting. Ultimately, I chose against it. Introducing a new tag would only dilute the message. The original phrase remains entirely valid because our new herds of cattle are made of silicon and packed into server racks. These vast, humming arrays of GPUs consume serious power. Incredibly serious power. There are endless articles and studies about the terrifying electricity draw, the evaporated cooling water, and the immense emissions tied to massive training runs and constant inference.

#cowfart remains the perfect way of saying: "Your prompt layout is terrible. Do better. Think of the planet, you clock-cycle megalomaniac."

I caught myself last week doing exactly the thing I am writing against. I fired up a top-tier, frontier model for a basic two-sentence job. Three follow-up prompts later, I finally had the answer I easily could have extracted from a much smaller model, or even from just reading the original text myself for thirty seconds. The cloud servers did the heavy lifting while I did my little prompting dance. I felt clever at the time; I felt significantly less clever once I realised how many tokens had flown for something that never needed to leave my laptop.

Those small local experiments are highly useful because they make the true cost visible again.

I digress, though. It is what I do. It is an accidental hobby of mine.

The point is that tokens do not arrive free, especially not in energy terms.

Okay, okay... GPUs guzzle, prompts fly, people stopped counting tokens, and queries are fired off faster... get to the point already!

So, here's the thing...

If you fire off sloppy prompts that wander aimlessly, require three separate follow-ups to get clear, or dump an entire novel of previous chat history just to ask a simple question, the model has to work significantly harder. If it works harder, or if a massive model gets pulled in just to wade through your formatting noise, more electricity flows. More servers spin up. More cooling systems kick in. On a single individual chat, meh... what's the difference, right? Time to hit that digital water cooler again.

Scale that lazy behaviour across billions of devices and users, casually querying every hour of every single day... well... that represents a staggering amount of electricity, water, and heat being spent simply because your prompt could have been tighter.

None of this is an argument against AI itself. I am a heavy user, and I am genuinely excited by what these systems can achieve. The art of the possible feels new in a way that still surprises me most days. I just want that excitement to travel with a modest bit of care. Not every trivial task needs a frontier model. Sometimes the most sustainable and ethical choice is still the one that happens entirely between your own ears, or with a tiny local script running silently on your own machine.

Although your prompt might never power the next massive venture-backed product or run inside a major enterprise platform where it gets called millions of times, that is still absolutely no reason to treat planetary resources as infinite.

Always craft the best prompt you can. Choose the smallest model that will actually complete the job. Cache answers you ask often. Think for a single moment before you type. Reuse context carefully instead of re-sending everything blindly. These are not radical, groundbreaking ideas; they are just old-school engineering efficiency dressed up in new clothes.

The end is nigh...

Calm down, I just mean the end of the article is nigh.

And so, without further ado, next time you open a chat interface or look at a prompt someone else shared, and you spot one that you know could have been leaner, more direct, and properly right-sized for the task...

do the polar bears a solid...

keep some habitat for the bees...

think of the children...

Won't somebody please think of the children?

And, as a fun, lighthearted way to say "Hey, this prompt you wrote. It works. It even got a useful answer. Thing is, it could have used far fewer resources from the planet. Do better. Think of the planet, you clock-cycle megalomaniac."... just put #cowfart in there.

Because the planet's worth it.

Fin.

Wait, wait, wait... not Fin.

The Organic Counter-Argument

Naturally, the contrarians in the audience are already cracking their knuckles to type a furious rebuttal. I can hear the argument now: a modern frontier model chewing through a complex prompt in two minutes flat might draw a hefty spike of power, yet it surely consumes less cumulative resource than the biological alternative.

Think about the sheer, decades-long footprint of a human being. A human requires a quarter of a century of continuous development, vast oceans of water, mountains of food, climate-controlled housing, and an ongoing, expensive habit of demanding entertainment just to stay sane. We require a monumental investment of planetary energy simply to sustain our existence long enough to reach cognitive maturity. If a machine can complete a task in a fraction of the time, the net resource draw of that specific process might actually be significantly lower than paying a human to sit there and think about it.

The real answer to this equation remains highly debatable, quickly crossing into all manner of thorny ethical minefields.

If AI tools are merely additive, meaning we are simply using them to generate millions of extra, unneeded pieces of digital noise on top of our existing human output, then we are looking at a pure net loss for the planet. Conversely, if an AI completely replaces a traditional human workflow, it might truly be less resource-intensive. That path, though, introduces a distinct ethical dilemma regarding human displacement, economic survival, and societal value.

What is the ultimate solution? For now, we must strike a delicate balance. There is no magic, overarching answer to this problem right now, at least not until we successfully architect a fully functioning Utopia. I am actually planning to map out that particular technological daydream in a future article, so keep an eye out for that.

Until we reach that utopian horizon, let us focus entirely on the low-hanging fruit. We can easily call out the blatant, lazy AI usage right in front of our faces. With a simple, timely deployment of #cowfart, we can at least begin to solve the immediate problems we actually have the power to control.

Fin.

For realsies this time.

Wednesday, 27 March 2019

Is your code eco-friendly?

Do you realise that poorly written software is a contributor to global warming?

Although I have absolutely no data to base this on, please, read on... I assure you that you will not only conclude that this is a true statement; if you code, you may even feel compelled to write better code. If that's not enough of a hook, I will introduce to and encourage you to use, this hashtag in your code reviews:


#cowfart

Let me set the scene...


There's a lot of software out there, running on billions of devices across the globe, and sadly, a lot of that code is not optimised.

Back in the day when we wrote in assembler on tiny 8-bit computers we would count clock cycles (honestly; it wasn't just me!) and refactor, refactor, refactor... until we got the best oomph out of the CPU that we could.

As if by magic, computers started popping up everywhere and hardware started to get really fast. And cheap. Suddenly, it was not about clock cycles. It was all about time-to-market. Get the code cut fast, get it released, and if it didn't run very well, upgrade the hardware!

It really was that simple for a long time; certainly for most business software anyway. Games, well that's different because if you have lag... you suck. Well, your game does, and it won't sell. In business software, having things take a while isn't necessarily a problem... more time at the water cooler, more time to do all the admin things.

Sidenote: I would encourage every budding programmer, and even seasoned programmers, who have only worked in business application development, to do some games programming. The techniques you will learn in order to survive out there are transformational.

Technology has moved along at a rapid pace. Astonishingly fast, and astonishingly cheap. And the world, largely, depends on it being that way.

The plot thickens...


Thing is, we've got big problems out there.

With climate.

Okay, not just with climate; other big problems are available.

You don't have to just believe in it anymore either; it's fact, evidenced in the starkest possible ways.

We take a tangent...


Before we get back to my main point, I did promise you a cool hashtag to use in code reviews.


#cowfart

Why? Well, because it is believed that cows are a significant contributor to global warming because there are a lot of cows out there. And they fart. Quite a lot actually. There are many articles and research studies about it.



Okay, okay... cows fart, hardware got better, people stopped counting clock cycles, and released products faster... get to the point already!

So, here's the thing...


If you write sloppy code that does not perform as well as it could, it will take longer to execute. If it takes longer to execute, or if it requires additional processing power just to make it run, you are using more hardware, more electricity, and creating more heat. On a single PC, meh... what's the difference, right? Time to hit the water cooler.

If you scale that up to run on billions of devices across the planet, well... that's a staggering amount of electricity, time, and heat being wasted by your code.

Although your code might not get to be in the next kernel of Linux, Windows, Android, or some other place like Facebook, where it might be executed trillions of times, that's not a good reason to write sloppy code.

Always write the best code you can, and educate yourself on performance tuning.

The end is nigh...


And so, without further ado, next time you review some code or give yourself a TODO:, and see code that you know the could be better performing...

do the polar bears a solid...
keep some habitat for the bees...
think of the children...

Won't somebody please think of the children?

And, as a fun way to say "Hey, this bit of code you wrote. It sucks. It might work, it might even read like a poem. Thing is, it could perform much better. So sort it out."... just put #cowfart in there.

Because the planet's worth it.

Fin.