Sustainable business: 5 tips to boost code efficiency

In recent years, adopting sustainable business practices has become an important aspect of corporate branding and an expected factor in doing business.

Customers, partners, and channels are now routinely inquiring about companies’ sustainability strategies. Employees are proud to contribute to ecologically sensitive companies that make responsible decisions regarding the environment.

However, as more organizations compete based on their data insights, applications with big data analytics and AI/ML models are creating a huge and fast-growing carbon footprint. According to recent research from ByteDance AI Lab, the number of computations used to train deep-learning models has increased 300,000x in six years, raising concerns about the environmental impact.

[ Also read How Cloud AI Developer Services empower developers. ]

5 steps to reduce carbon emissions from software

Software that contains a large number of nonessential functions, or bloated code, can make excessive demands on computer resources, resulting in wasted energy. Companies need to implement analytics practices as standard operations procedures to keep software trim.

Here are a few practices to make analytics more energy-efficient:

1. Measure your carbon footprint

Software is available that seamlessly integrates into an existing codebase and estimates the amount of carbon dioxide (CO2) produced by the computing resources used to execute the code. In addition, there are tools that calculate the efficiency of coding algorithms.

[ Related read: How open source supports businesses’ impact on climate change ]

2. Don’t reinvent the wheel

There are thousands of pre-trained and proven AI/ML models and applications available. Using proven code not only accelerates development time by eliminating the trial-and-error of creating code from scratch, but it also increases the chances that the resulting code will be more reliable, robust, and efficient.

3. Use more precise data types

Number values ​​can have an influence on the number of calculations that are required. Training an ML model typically involves floating-point numbers that allow for a varying number of digits after the decimal point. However, this flexibility uses more energy than fixed points or integers.

Also, the storage space defined for each number has an impact. They can take as little as 1 byte and as much as 8 bytes, depending on the value of the integer. Fewer bytes require less storage space, which translates to higher energy efficiency.

4. Use batches where possible

Batch processing is a cost-effective means of handling large amounts of data. When performing big data analytics, loading subsets of the data instead of the entire data set takes up less memory, which reduces the computer processing and energy requirements.

5. Greener platforms for data processing

The type of software performing computations also contributes to the number of computing resources required. Using a platform that is specifically designed for processing massive amounts of data while optimizing memory and storage to reduce energy consumption can lead to more sustainable analytics.

More on digital transformation

Sustainable code is good business

Developing a code that uses computer resources efficiently is more than a trend. The Green Software Foundation (GSF) is dedicated to designing, architecting, and coding software that consumes less energy. Their goal is to increase awareness of the importance of efficient code and to encourage business leaders to buy from vetted GSF members.

With public clouds also competing for their own sustainability, they might soon require visibility into a workload’s carbon footprint, with fines for processing considered excessive or unnecessary.

Sustainability is becoming a must, all the way down to the code. Having a code efficiency standard should be an important part of any sustainability program. Keeping lean software isn’t just good for the planet; it’s also good for business.

[ Discover how priorities are changing. Get the Harvard Business Review Analytic Services report: Maintaining momentum on digital transformation. ]