Grab reduces size of its superapp by 25% to ensure survival – The Register

In 2019, Grab, a developer of a superapp in Southeast Asia, identified an issue: the size of its application was increasing by one percent each month, making it less suitable for the economical smartphones commonly found in the regions where it operates. This was leading to a decrease in user satisfaction and potentially hindering its ability to attract new users.

“With the continuous expansion of the app and addition of new features, Grab recognized the importance of providing a consistent, high-quality experience for users with limited storage space or restricted internet connectivity,” stated the developer in a recent post on its engineering blog.

The Grab app initially focused on ride-hailing services, but over the years it expanded to include food delivery, parcel delivery, mobile payments, and even offering loans to drivers.

While not all users make use of every feature, all options were present in the app, which had grown to encompass four million lines of code.

During Q3 of 2021, the company based in Singapore launched Project Bonsai, aiming to reduce the download size and disk space taken up by its application. After six months of work, they managed to decrease the download size by 26% and also made progress in reducing storage requirements.

Prior to Project Bonsai, Grab had already been implementing an app bundle strategy and customizing APKs for specific device configurations. They also closely monitored changes in the app, set up monitoring for APK file sizes for each commit, used code optimization tools, prioritized the use of vector images over raster images, removed unused languages, and reviewed third-party libraries for unnecessary bloat.

Despite these efforts, more needed to be done. With Project Bonsai, Grab focused on measuring, reducing, and controlling the size of its app through various strategies.

One of the first steps was the development of a tool called App Sizer, designed to analyze binaries from bundle files and integrated into their workflow for better monitoring and observability of device-specific download sizes, identification of storage-consuming elements, and creation of a list of large files.

Grab intends to release this tool as an open-source project in the near future.

To minimize the app’s size, Grab opted to address the biggest contributors rather than adding new features.

“Our main efforts were concentrated on optimizing dex file size, refining resources, and eliminating duplication and redundancy,” explained Grab.

The Java/Kotlin code was identified as the main factor in the app’s size, with R classes being a major concern. These classes contained references to resources from their dependencies, contributing to bloating issues.

It was discovered that the app contained over 1,500 modules and third-party libraries, resulting in large R classes and unexpected spikes in size with certain commits. By updating configuration rules, automating testing, and removing redundant code, Grab managed to make significant progress in reducing the app’s size.

Reduce Excess

When large files were identified, the team responsible was encouraged to remove them if unnecessary, transfer them to a cloud server, or convert them to more efficient formats.

Grab also streamlined fonts by eliminating unused typefaces and duplicates, aiming to adopt a single font for the app.

One specific library accounted for a large portion of the storage footprint, and once removed along with duplicate functions from other libraries, contributed to reducing the overall size of the app.

Implementing a feature toggle to disable functions remotely also aided in the size reduction efforts.

Grab continues to explore various methods to maintain a lean app, including adopting common UI components and experimenting with dynamic delivery.

The company is considering assigning each team an “app size budget” to ensure continued focus on optimization and user experience enhancement.

“Through prioritizing code optimization, resource management, modularization, and asset bundling, Grab achieved significant reductions in app size while improving user satisfaction,” proclaimed Grab.

The issue of app bloat is a persistent one, especially in regions like Southeast Asia where smartphone usage is increasing but affordability remains a concern.

A survey conducted on Asian consumers in the previous year revealed that a majority of respondents in the 18-40 age group preferred mid-range phones due to their cost-effectiveness, even if it meant sacrificing some features. This study was commissioned by Poco, a brand backed by Xiaomi, so it may be viewed with caution. ®

Leave a Reply

Your email address will not be published. Required fields are marked *