Threads is a new app from the Instagram team for “for sharing text updates and joining public conversations.” Maybe this was in the plans for awhile, maybe the Meta / Instagram team thought that people might be looking for a new app for sharing updates with text 🤷.
Meta has dedicated significant in-house resources to optimizing mobile performance. You can look through our analysis for any app and where many apps are loaded with Emerge Insights, Meta mobile apps are highly optimized. Meta uses some patterns that aren't a typical best practice, but Meta has the infrastructure and engineering power to pull it off well.
Threads Android App
- Like other Meta apps, Threads is being shipped as a universal APK. AABs are considered a best practice, but Meta aggressively optimizes its universal APKs — obfuscating resources, custom packaging shared libraries, and using Redex.
- It was surprising to see Threads is shipping debug code. Threads has debug packages like
- They’re using React Native for some portion of the app -
InstagramBundle.js.hbc.spk.xzis likely a compressed version of Hermes bytecode (
- There’s a large
.spofile that looks like a compiled version of different native libraries. There’s a metadata file packaged with it:Our guess is that the .spo file is a merged version of all native libraries, second entry is the offset / size, third entry is the checksum
arm64-v8a/librtc.so 11336240 bda527a307edd868700fccfab15481f403d3f39363289d5d6a717579f284bed7 arm64-v8a/libgojni.so 11330024 616915938eb1face6aa3392aedab8bddce280f2b84423377ac65896a6b3faad7 arm64-v8a/libarfxgraphicsmerged.so 9710600 afb00aa881a63b20371e447dbbad61fefcf4df2c23c922a9e44e2171d7a649ad ...
- From @richz's (Threads engineer) post, Threads is largely using Jetpack Compose for its UI. The compose portion of the dex is relatively small (~130 KB) compared to the overall dex size. This could mean that they are efficient in their usage of Compose and/or they shared code from Instagram, making the usage appear less than what it is.
Similarities with the Instagram App
Threads appears to share a lot with the Instagram app (v222.214.171.124.49). The aforementioned
InstagramBundle.js.hbc.spk.xz is similar for Threads & IG. The
/assets/dsp is also the same between both apps. It makes sense that these apps would share code seeing as Threads is heavily integrated with Instagram.
Threads iOS App
Two things stand out for Threads on iOS:
- Threads has 0 dynamic libraries, whereas the Facebook app which heavily utilizes dynamic frameworks.
- Threads has one of the largest plugins we’ve ever seen.
BarcelonaShareExtensionis 81 MB. For context, the largest Instagram plugin -
InstagramNotificationExtensionis 23.5 MB. The
InstagramShareExtensionis 5.6 MB
FBSharedFramework shares a lot of the same elements as Thread’s BarcelonaShareExtension.
Some notable shared elements
- The asset catalog is almost the exact same
As with the Android app, it looks like they were able to share significant amounts of code between Threads & Instagram to help speed up development. Threads team wanted to move fast and took whatever code it could from Instagram and shoved it where it needed to go.
Looking at Threads Startup Time
While much of our X-Ray is obfuscated, we were able to use ETTrace to look at Threads Startup time
We’re working with obfuscated builds so there’s only so much you can get from a stack trace. We do see that there’s a good amount of pre-main time (~50 MS from the trace collected).
There’s also a
WKWebView initialized in app launch, which is pretty slow. This suggests that their sign-in experience isn’t native and they are showing a webview, or they are using it in the background for tracking purposes.
There's only so much we can gather looking at public Meta builds, but it looks like Threads is heavily borrowing from Instagram on both platforms. Will be interesting to see if that changes.