The search for an elusive bottleneck
Birdie software engineers spent a month examining various aspects of the app in an attempt to pinpoint its performance issues. Along the way, they made multiple changes to streamline and optimize the app. “After a month, it was a little better,” says Godechot. “But because we lacked the tools and processes to see the impact of the changes we were making, we were still in the dark.”
Birdie engineers looked into multiple monitoring solutions, but none provided adequate insight into why performance was suffering. Birdie was already using Datadog Application Performance Monitoring (APM) and Datadog Log Management, so Birdie engineers decided to look into Datadog Real User Monitoring (RUM) as well. “Datadog RUM was easier to implement and more user-friendly than some of the other solutions we looked at,” says Godechot.
“Datadog RUM immediately allowed us to measure the impact of the changes we were making.”
Godechot and his team imported Datadog's RUM SDK into their React Native code and began looking for ways to compare the performance metrics of specific UX flows before and after changes. They used multiple devices on multiple versions of the app to go through specific flows multiple times. They were then able to compare them by finding their recorded sessions in Datadog RUM. “Datadog RUM immediately allowed us to measure the impact of the changes we were making,” says Godechot.
Based on their findings, Birdie engineers tried several approaches to improve performance. Unfortunately, the app was still slow. Finally, they examined user permissions. Birdie uses two types of permissions, one for the agency level and one for the client level. These user permissions were introduced when the app was launched four years ago. At that time, they had approximately 15 permissions per user. Four years later, they had more than 10,000 permissions per user. Those permissions were read throughout the app by most components and actions. That data structure made reading and finding permissions very slow, which impacted all pages in the app. “Once we realized the problematic code that was looking through permissions was used throughout most redux functions, we instrumented those functions and used RUM to measure the impact of the change and prove that it was indeed our bottleneck,” says Godechot.
Birdie engineers then performed a simple change to turn the permissions array into an object. “Making that change reduced some app actions from 40 seconds to four seconds when we used it with a test agency that has much more data than our largest agency has.”
“Making that change reduced some app actions from 40 seconds to four seconds when we used it with a test agency that has much more data than our largest agency has.”