Shopify

How Shopify Improves Shopify App’s Performance

Original post Improving Shopify App’s Performance

Article Summary

Shopify's mobile app was getting slower after migrating to React Native. So they spent a year making it blazingly fast again.

The Shopify engineering team noticed performance degrading in their merchant-facing mobile app throughout 2023. They set ambitious goals: screen loads under 500ms (P75) and app launch within 2 seconds. Here's how they achieved it.

Key Takeaways

Critical Insight

Through systematic optimization of rendering, caching, and unnecessary work elimination, Shopify cut app launch time by 44% and screen loads by 59%.

Continue reading

What This Article Covers

Problem

Shopify's mobile app was loading too much content off-screen right from the start. Screen loads hit 1400ms at the P75 mark, and the app itself took about 4 seconds to launch. This wasted device resources unnecessarily.

Solution

The team made two key changes. They optimized the Restyle library to cut down on object creation overhead. They also froze background components so they wouldn't update needlessly when navigating between screens. The result was Restyle overhead dropping below 2%.

Impact

Freezing background components cut navigation time by up to 70% on some screens. The Restyle optimization also made component rendering more efficient across thousands of components in the app.

The article includes actual code snippets for their custom LazyScrollView component and batched state updates hook that you can adapt for your own apps.

This page summarizes “Improving Shopify App’s Performance” by Shopify, published Mar 5, 2024. All credit for the original work goes to the authors.

Read the original on shopify.engineering (opens in new tab)

AI tools for React Native

Browse all AI tools →