Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News How Spotify Fights Global Warming by Taking Their Mobile App Size under Control

How Spotify Fights Global Warming by Taking Their Mobile App Size under Control

This item in japanese


Adding new features has often a hidden impact on app size, with several undesired effects, including user disengagement and unnecessary carbon emissions. To keep app size under control, Spotify engineers established pre-PR and post-PR processes to help prevent an estimated 10MB app size growth over six months.

While app size is not often at the core of developers' interest, it is by any means an important factor to take into account, argue Spotify engineers Viktor Petrovski, Dmitry Povolotskyi, and Bruno Rocha.

App size affects users in two distinct dimensions, network bandwidth and storage. While those are not usually a concern for most people living in so-called developed countries, they usually are for 85% of the world population, due to factors like the prevalence of older devices with reduced storage or network bandwidth. According to an experiment led by Google, furthermore:

For every 6MB increase to an app’s size, the app’s installation-conversion rate decreased by 1%. The implications are profound, leading to a multitude of missed opportunities.

However, app size is bound to become a concern even in developed countries due to the effect that network traffic has on global warming. Spotify engineers provide data that show that only for updating their mobile app across its user base, a staggering 930+ petabytes of data traveled across the Internet. Using a popular model currently available, the one-byte model developed by the Shift Project, and EPA data for 2019, they estimated network traffic to equate to around 65,000 tonnes of CO2, the equivalent of 65,000 individuals taking a round trip flight between London and New York.

To help keep app size under control, Spotify relies on strict pre-merge and post-merge processes. In the pre-merge process, each PR is analyzed using Emerge Tools to assess its impact on app size. If it is larger than 50KB, a dedicated team further analyzes it applying several criteria and approves or rejects it.

The post-merge process attempts to get a more global view of app size evolution from build to build. Indeed, even if each PR is smaller than 50KB, the overall app size growth from all PRs that go into a build can be significant. Again, Emerge Tools are key here. They provide a detailed breakdown of compilation units and how much each contributes to app size. This data is then used to pinpoint which teams have contributed most to app size growth and to build analytics to compare teams' performance.

Establishing attribution and holding each team responsible for its impact allows us to effectively maintain a balance between rolling out new features and ensuring that our app size remains within reasonable limits.

Overall, this two-fold process allowed Spotify engineers to identify 100+ PRs that triggered warnings, of which 53 were revised to reduce their size. This made it possible to prevent app size increase by over 10MB as well as to establish a shared culture across engineers to strive for smaller PRs in the first place.

About the Author

Rate this Article


Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p