Posted by Ben Weiss – Developer Relations Engineer, and Lauren Darcey – Senior Engineering Supervisor, Reddit
Reddit is among the world’s largest web boards, bringing collectively numerous communities searching for leisure, solutions to on a regular basis questions, and a lot extra.
Not too long ago, the workforce optimized its Android app to cut back startup instances and enhance rendering efficiency utilizing Baseline Profiles. However the workforce didn’t cease there. Reddit app builders additionally enabled Android’s R8 compiler in full mode to maximise bytecode optimization and used Jetpack Compose to rewrite legacy UI, bettering each the consumer and developer expertise.
Maximizing optimization utilizing Baseline Profiles and R8 full mode
The Reddit Android app has undergone numerous efficiency upgrades through the years. Reddit builders have lengthy since cleared the checklist of fast and straightforward duties for optimization, however the workforce nonetheless desires to enhance the app, bringing its efficiency to the following stage and guaranteeing it runs nicely on each Android machine.
“Reddit is searching for any strategic enchancment to its app efficiency so we will make the app expertise higher for brand spanking new and current customers,” stated Rob McWhinnie, a workers engineer at Reddit. “Baseline Profiles match this use case nicely since they’re primarily based on vital consumer journeys.”
Reddit’s platform engineering workforce used screen-specific efficiency metrics and observability to assist its characteristic groups enhance key metrics like time to interactive and scroll efficiency. Baseline Profiles had been a pure match to assist enhance these metrics and the consumer expertise behind them, so the workforce built-in them to make monitoring and optimizing simpler, utilizing insights from geodata and machine courses.
The workforce constructed Baseline Profiles for 5 vital consumer journeys thus far, like scrolling the house feed, logging in, launching the full-screen video participant, navigating between subreddits and scrolling their feeds, and utilizing the chat characteristic.
Simplifying Baseline Profile administration of their steady integration processes, enabled Reddit to take away the necessity for handbook upkeep and streamlining optimization. Now, Baseline Profiles are robotically regenerated for every launch.
Enabling Android’s R8 optimization compiler in full mode was one other space Reddit engineers labored on. The workforce had already used R8 in compatibility mode, however a few of Reddit’s legacy code would’ve made implementing R8’s extra aggressive options tough. The workforce labored by the app’s current technical debt first, making it simpler to combine R8’s full mode capabilities and maximize Android app optimization.
Enhancements with Baseline Profiles and R8 full mode
Reddit’s Baseline Profiles and R8 full mode optimization led to a number of efficiency enhancements throughout the app, with early benchmarks of the primary Baseline Profile for feeds exhibiting a 51% median startup time enchancment. Whereas responses from Redditors initially confirmed massive startup enhancements, Baseline Profile optimizations for much less frequent journeys, like logging in, noticed fewer consumer stories.
Baseline Profiles for the house feed had a 36% discount in frozen frames’ ninety fifth percentile. Baseline Profiles for the neighborhood feed additionally delivered robust display screen load and scroll efficiency enhancements. On the ninetieth percentile, display screen Time To Interactive improved by 12% and time to first draw decreased by 22%. Reddit’s scrolling efficiency additionally noticed a 12% discount in P90 sluggish frames.
The improve to R8 full mode led to a rise in Google Play common rankings. The proportion of world constructive rankings (fours and fives) elevated by 4 p.c, with a notable lower in destructive stories. R8 full mode additionally decreased complete application-not-responding errors by nearly 30%.
General, the app noticed chilly begin enhancements of 20%, scroll efficiency enhancements of 15%, and widespread enhancements in lower-end units and rising markets. Google Play vitals noticed enhancements in sluggish chilly begins, a ten% discount in extreme frozen frames, and a 30% discount in extreme sluggish frames. Almost 75% of screens, refactored utilizing Jetpack Compose, skilled efficiency positive aspects.
Additional optimizations utilizing Jetpack Compose
Reddit adopted Jetpack Compose years in the past and has since rebuilt a lot of its UI with the toolkit, benefitting each the app and its design system. Based on the Reddit workforce, Google’s ongoing help for Compose’s stability and efficiency made it a powerful match as Reddit scaled its app, permitting for extra environment friendly characteristic growth and higher efficiency.
One main instance is Reddit’s feed rewrite utilizing Compose, which resulted in additional maintainable code and an improved developer expertise. Compose enabled groups to deal with future work as a substitute of being slowed down by legacy code, permitting them to repair bugs rapidly and enhance total app stability.
“The R8 and Compose upgrades had been vital to deploy in relative isolation and stabilize,” stated Drew Heavner, a workers engineer at Reddit. “We really feel like we received nice outcomes from this work for all groups adopting our fashionable tech stack and Compose.”
After upgrading to the September 2024 launch of Compose, the most recent iteration, Reddit noticed vital efficiency positive aspects throughout the board. Chilly begin instances improved by 13%, extreme sluggish frames decreased by 25%, and frozen frames dropped by 10%. Low- and mid-tier units noticed even better enhancements the place app begin instances improved by as much as 40%, particularly in markets with lower-performing units.
Screens utilizing Reddit’s fashionable Compose-powered design stack confirmed substantial enhancements in each sluggish and frozen body charges. For instance, the house feed noticed a 23% discount in frozen frames, and scrolling efficiency visibly improved in response to inside opinions. These updates had been nicely obtained amongst customers and mirrored a 17% enhance within the app’s Google Play common ranking.
Up-leveling UX by optimization
Including worth to an app isn’t nearly introducing new options—it is about refining and optimizing those customers already love. Investing in efficiency enhancements made Reddit’s key options sooner and extra dependable, enhancing the general consumer expertise. These optimizations not solely improved app startup and runtime efficiency but additionally simplified growth workflows, rising each developer satisfaction and app stability.
The deal with high-traffic options, comparable to feeds, has demonstrated the facility of efficiency tuning, with substantial positive aspects in consumer engagement and satisfaction. Because the app has turn out to be extra environment friendly, each customers and builders have benefitted from a cleaner codebase and sooner efficiency.
Wanting forward, Reddit plans to increase the utilization of Baseline Profiles to different vital consumer journeys, together with Reddit’s publish and remark experiences, guaranteeing much more customers profit from these ongoing efficiency enhancements.
Reddit’s platform engineers additionally wish to proceed collaborating with characteristic groups to combine efficiency enhancements throughout the app. These efforts will be sure that because the app evolves, it stays a clean, quick, and interesting expertise for all Redditors.
“Including new options isn’t the one approach so as to add worth to an expertise for customers,” stated Lauren Darcey, a senior engineering supervisor at Reddit. “Once you discover a characteristic that customers love and have interaction with, taking the time to refine and optimize it may be the distinction between an excellent and an amazing expertise in your customers.”
Get began
Enhance your app efficiency utilizing Baseline Profiles, R8 full mode, and Jetpack Compose.