Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Meta Engineering 15 min read Case study mediumAdept

How we think about Threads’ iOS performance

Threads iOS tracks performance through three headline metrics: %FIRE (frustrating image renders), TTNC (time to fresh network content), and cPSR (creation-publish success rate). A binary-size gate on every commit keeps the app a quarter the size of Instagram, and non-incremental builds run twice as fast. A latency-injection boundary test showed that even fractions of a second of added navigation latency reduced launches, likes and conversation views. That finding led to SLATE, a logger that automatically places latency markers through shared UI components, and SLATE was then used to confirm that GraphQL matched REST on p95 latency before GraphQL was adopted for new endpoints. On publishing, Drafts cut posting-related bug reports by 26%, but a disk-usage bug introduced after its launch then had to be fixed.

Assumes: iOS app developmentA/B testing basics

Related posts

  • Cutting Threads’ send latency in half

    Meta Engineering mediumAdept

    Instagram's Threads messaging app cut media send latency in half, partly by fixing a "configure" endpoint that ran four times slower in one region. The endpoint was IO-bound on a read-optimized write-through cache whose backing store lived in another region, so every write paid a cross-region round trip. Routing the whole web request to the region hosting the backing store batched those round trips. A client-side A/B flag, sent as an HTTP header and matched by a routing rule, showed about a 29% send latency improvement.

  • How we improved availability through iterative simplification

    GitHub Engineering mediumAdept

    GitHub cut timeouts in its Rails monolith with small, measured changes found through Datadog metrics, Splunk logs and custom MySQL slow-query monitors. Each change was validated with Scientist experiments or rolled out gradually behind Flipper feature flags. Reordering a Command Palette query to look up a user's contributions before filtering by org removed a large IN clause and was 80-90% faster, and batching access checks added another 20-80% and 30-40%. Skipping unneeded authorization filters on a busy redirect endpoint cut tail latency and timeouts. Not every idea paid off: moving sorting into the application was 40-80% slower, so that experiment was dropped.

  • Improving Shopify App’s Performance

    Shopify Engineering mediumAdept

    Shopify cut its React Native mobile app's P75 launch time by 44% and screen load times by 59% over 2023, against targets of 2s launch and 500ms critical-screen loads. The fixes fell into three themes. The first was deferring work until it is needed: FlashList-based LazyScrollView and ListSource render only visible content, inlineRequires in the Metro config alone gave a 17% launch gain, and slow native modules were fixed. The second was eliminating unnecessary work: freezing back-stack screens cut navigation time by up to 70%, Restyle allocations were trimmed, and default state batching improved screen loads by about 15%. The third was maximizing cache use by fixing a GraphQL cache bug and pre-warming caches so up to 90% of merchants see cached data first.

  • Client Tracing: Understanding Mobile and Desktop Application Performance at Scale

    Slack Engineering mediumAdept

    Slack extended its backend distributed tracing to iOS, Android and JavaScript clients so engineers could pinpoint why client actions like channel switches are slow. API calls are broken into queue, HTTP request and parse spans, with trace IDs propagated in HTTP headers to join client and server spans. SQLite access is split into wait, execute and save spans, and a general view-load trace schema covers cache-then-network screens. Slack built its own Swift/Kotlin/JS tracing API instead of OpenTracing because thread-local context breaks on highly concurrent mobile code. The API passes an explicit TraceContext, samples traces (1% of API requests), and flushes open traces when the app is backgrounded.

  • The evolution of Facebook’s iOS app architecture

    Meta Engineering mediumAdept

    Facebook's iOS app grew over ten years into a C++/Objective-C++/Swift codebase built around in-house abstractions, dynamically loaded libraries, and Buck-driven code generation. Mutable Core Data models and MVC's bidirectional data flow led to the React-inspired ComponentKit, which brought a 50% performance gain. Startup times of nearly 30 seconds drove product code into lazily loaded dylibs, whose runtime failures were later turned into build-time errors by a plugin system generated from Buck dependency-graph queries. The recurring tradeoff is user experience and reliability against idiomatic iOS development, with the Swift-era language guidance of keeping C++ out of product-facing APIs giving developer efficiency more weight.

The quest for software engineering knowledge.

Look:
Layout: