Inside Meta’s Threads: How the Viral App Was Built for Mobile and Backend
The article dissects Meta's Threads app, detailing its explosive user growth, the mobile engineering choices for Android and iOS—including universal APKs, Jetpack Compose UI, and large share extensions—while also revealing the Python‑based Cinder backend, performance optimizations, startup profiling, and the extensive code sharing with Instagram.
Threads Architecture Overview
Meta launched Threads on July 5, quickly reaching 70 million users in 48 hours and surpassing 100 million logins within a week, outpacing even ChatGPT’s growth. The app’s rapid adoption is driven by strong natural demand despite limited promotion.
Mobile Implementation
Analysis by Emerge Tools shows that both Android and iOS versions share many engineering patterns with other Meta apps.
Android Build
Threads uses a highly optimized universal APK that bundles resources, custom shared libraries, and Redex‑processed code, rather than the newer AAB format. Debug packages such as com.instagram.debug.devoptions.sandboxselector and com.instagram.debug.quickexperiment are included.
Part of the app is built with React Native; the file InstagramBundle.js.hbc.spk.xz appears to be a compressed Hermes bytecode bundle.
A large .spo file contains merged native libraries. Example entries are:
arm64-v8a/librtc.so 11336240 bda527a307edd868700fccfab15481f403d3f39363289d5d6a717579f284bed7
arm64-v8a/libgojni.so 11330024 616915938eb1face6aa3392aedab8bddce280f2b84423377ac65896a6b3faad7
arm64-v8a/libarfxgraphicsmerged.so 9710600 afb00aa881a63b20371e447dbbad61fefcf4df2c23c922a9e44e2171d7a649ad
...The UI is primarily built with Jetpack Compose, keeping the DEX assembly small (≈130 KB) and allowing efficient code sharing with Instagram.
iOS Build
The iOS version contains no dynamic libraries, unlike many Facebook apps, but includes massive share extensions such as BarcelonaShareExtension (≈81 MB), far larger than Instagram’s comparable extensions.
Backend Powered by Cinder
Threads’ backend runs on Cinder, Meta’s high‑performance fork of CPython 3.10. Cinder adds JIT compilation, lazy module loading, pre‑compiled static modules, and experimental bytecode optimizations that leverage type annotations for faster execution.
Meta uses Cinder internally for Instagram and other services, aiming to push CPython performance forward. However, Cinder is not a production‑ready replacement for external developers.
A notable feature is the “Immortal Instance” mechanism, which disables reference‑count‑based object reclamation for selected objects, saving roughly 5 % of overhead at the cost of potential speed trade‑offs.
Startup Performance
Emerge Tools employed ETTrace to generate flame graphs of Threads’ launch sequence. The profiling reveals a significant “pre‑main” phase (~50 ms) and a slow‑initializing WKWebView used for login, indicating that the login flow relies on a web view rather than a fully native experience.
Code Sharing with Instagram
Both Android and iOS builds reuse substantial Instagram code, including identical assets (e.g., InstagramBundle.js.hbc.spk.xz) and shared directories. iOS extensions such as BarcelonaShareExtension share many components with Instagram’s FBSharedFramework, including identical bundles and ML model files.
This extensive sharing accelerates development but raises questions about whether Threads will eventually “de‑Instagramize” its codebase.
Missing Features
Current limitations include the absence of a translation button, content search (only user search), hashtag support, post‑edit capability, and private messaging. Meta’s product VP Connor Hayes acknowledges these gaps and plans future updates.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Programmer DD
A tinkering programmer and author of "Spring Cloud Microservices in Action"
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
