Tech Tip #38: Not everything is worth optimising

Some code isn't worth the energy it takes to optimise.

Video created by explainapaper.com

The problem

Optimisation itself costs engineering time and, with AI tools, energy. A small, rarely run tool may never pay back the effort.

The fix you can use today

  • Estimate the saving: runs per year, instances, energy per run.
  • Estimate the cost: engineering time and any AI inference.
  • Only proceed where the return is clear; say no to the rest.

GreenCode checks first whether a change will save more energy than it costs, and skips it if not.

Tools that help

  • Green Algorithms calculator: estimates the carbon footprint of a computation from its runtime, hardware and location
  • cloc: counts lines of code by language, a quick way to size a codebase

How GreenCode helps

GreenCode helps tackle this by setting its own AI footprint against the saving it makes. It measures reductions in absolute terms and shows owners where capacity can be retired, so a saving can be banked rather than spent. More on this.

Tags

#governance#cost#refactoring

Sources

Transcript

Some code is not worth the energy it takes to optimise. Myth or fact: every optimisation is worth doing? Myth. Optimising costs engineering time. With AI tools, it costs energy too. A small tool that rarely runs may never pay that back. Here is the fix you can use today. Estimate the saving: runs per year, copies deployed, and energy per run. Estimate the cost: engineering time, and any AI you use. Only go ahead where the return is clear. Say no to the rest, and spend the time where it counts. GreenCode checks first whether a change will save more energy than it costs. If it will not, GreenCode skips it. Put numbers on it, using tools like the Green Algorithms calculator and cloc. GreenCode helps tackle this by setting its own AI footprint against the saving it makes. It measures cuts in real terms, so a saving can be banked, not spent. That was GreenCode Tech Tip number thirty-eight. Follow for the next tip, and find more on greencode.ai/tech-tips.

All GreenCode Tech Tips · All GreenCode videos

  • Tip #38
  • For CTOs and technical leads
  • Length 1:06
  • Category Strategy, reporting and procurement
GreenCode

Want this checked on your own system? Talk to the GreenCode team.

Get in touch