WhoBuilt

How we made our app 80% faster, a data structure story

Sep 21, 2022· 25 min· 2.8K views·Watch on YouTube

Speaker

Marin Godechot, a software engineer at Birdie, shares how the care app team improved performance at React Native EU 2022, hosted by Callstack.

An offline-first care app

Birdie builds software for home care agencies, including an app carers use to manage visits, tasks, medications, and observations. Because carers may work where mobile signal is weak, critical data needs to be available offline. Faster performance helps carers spend less time using the app and more time caring for clients.

Early fixes without a clear diagnosis

The team tried common React Native improvements, including reducing re-renders, using VirtualizedList, freezing navigation screens, and upgrading dependencies. The app seemed a little better, but without monitoring they could not measure the change. Manual testing showed that larger agencies tended to have slower performance.

The wrong data became the focus

The team suspected that large task data and Redux Persist stringification were slowing the app, so they explored WatermelonDB and later made task downloads optional. These changes took months and did not resolve the slowdown. Datadog RUM gave the team a way to measure real user performance and test its assumptions.

A permission lookup caused the slowdown

The actual bottleneck was a flat array of user permissions that had grown from about 15 to more than 10,000 per user. The team changed it into an object keyed by agency or client, reducing client permission lookup from scanning up to 10,000 entries to finding the relevant key and checking a shorter list. Switching agencies took about four seconds after the change, compared with 40 seconds before.

Monitoring confirmed the improvement

Standard mobile vitals did not reveal the difference, so the team added timing for Redux selectors, reducers, and sagas to Datadog. After the permission change, average durations fell by up to 92% for selectors, 90% for reducers, and 64% for sagas. Low-end devices saw the biggest gains, though high-end devices improved too.

Takeaways

  • Measure performance before committing to a costly fix.
  • Use real user monitoring because manual testing can hide problems on everyday devices.
  • Instrument application logic when standard performance metrics miss the bottleneck.
  • Review data structures and lookup complexity as data grows.
  • Optimize the user’s task flow, especially when the app supports safety-critical work.

Mentioned in this talk

Search inside this talk

What was claimed 13

Show all 13 facts

Related talks