App icon for Threads

Threads

July 7, 2023

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

Analysis Link
Version: 289.0.0.77.109
Download Size: 72.3 MB

  • 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 com.instagram.debug.devoptions.sandboxselector and com.instagram..debug.quickexperiment.
  • They’re using React Native for some portion of the app - InstagramBundle.js.hbc.spk.xz is likely a compressed version of Hermes bytecode (js.hbc)
  • There’s a large .spo file that looks like a compiled version of different native libraries. There’s a metadata file packaged with it:
    arm64-v8a/librtc.so 11336240 bda527a307edd868700fccfab15481f403d3f39363289d5d6a717579f284bed7
    arm64-v8a/libgojni.so 11330024 616915938eb1face6aa3392aedab8bddce280f2b84423377ac65896a6b3faad7
    arm64-v8a/libarfxgraphicsmerged.so 9710600 afb00aa881a63b20371e447dbbad61fefcf4df2c23c922a9e44e2171d7a649ad
    ...
    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
  • 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 (v289.0.0.25.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

Analysis Link
Version: 289.0
Install Size: 244.2 MB

Two things stand out for Threads on iOS:

  1. Threads has 0 dynamic libraries, whereas the Facebook app which heavily utilizes dynamic frameworks.
  2. Threads has one of the largest plugins we’ve ever seen. BarcelonaShareExtension is 81 MB. For context, the largest Instagram plugin - InstagramNotificationExtension is 23.5 MB. TheInstagramShareExtension is 5.6 MB

Interestingly, Instagram’s FBSharedFramework shares a lot of the same elements as Thread’s BarcelonaShareExtension.

Some notable shared elements

  • FilterAsset.bundle
  • ig_signals_cupid_better_recall_v1.mlmodelc & ig_signals_cupid_v2.mlmodelc
  • 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

GIF of generating a flame chart of Threads startup with ETTrace
Generating a flame chart of Threads startup with ETTrace

If you want to see Thread’s startup time for yourself, you can download this JSON file and upload it to ETTrace.

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.

Highlight of WKWebView in Threads' startup
Highlight of `WKWebView` in Threads' startup

TL;DR

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.

Sign up for our newsletter 🛸

Never miss a post or product update

Related articles



2024 © Emerge Tools, Inc. All rights reserved.