App icon for Apollo

Apollo

Aug 15, 2024

How much of a dead app is dead code? Well, remember Apollo?

Apollo app icon

Apollo shut down last year but is still on the app store with information on Christian Selig’s current projects. The current app bundle is largely unchanged from its days as a Reddit client, making it ideal for a Reaper demo.

There are different types of dead code. Some can be caught by the compiler or static analysis tools. For Apollo, much of the code is still technically valid, but can't be accessed by users. This is where Reaper's runtime analysis comes in.

  • Reaper monitors what classes a user hits
  • When a user backgrounds the app, Reaper sends a dump of all classes that were used
  • Data is aggregated across all sessions to find code that has never been touched

Most apps need many sessions to gather enough data. With Apollo, we can interact with the entire app and see just how much of it is dead code. Below is a video of interacting with a public version of Apollo that has Reaper injected into it.

Interacting with the Apollo app

After clicking almost every button in the app, we used 127 out of 1,038 classes. Close to 90% of classes were unused. Looking specifically at the Apollo module, we hit 33 out of 400 classes (8.25%). Many of the classes hit were from initializing third-party services like Bugsnag, Mixpanel, and Statsig. Below are all of Apollo's unused classes after multiple interactions.

Unused classes

Uploaded 2 months ago

We sent this to Christian before posting and here's what he had to say:

"This genuinely would have been pretty handy when Apollo was in full swing, the app morphed a fair bit over the years with user feedback and Reddit changes, so I’m curious how many of these classes were still applicable at the end when the app was fully functional."

The current Apollo is a fun example of how Reaper can work. In practice, Reaper is put in production to aggregate data across thousands or millions of sessions. Reaper turns usage into data points on how to optimize your app.

Example Reaper data in production
Example Reaper data in production

When integrated with your app, Reaper can show you not only the unused classes but also provide information on the specific file those classes are in. Below is a screenshot of data from Reaper in Emerge's HackerNews app, showing unused classes + the file they are in.

Example Reaper data in production
Example Reaper data in production

You can check out our docs on Reaper to learn more. Reaper is currently available on iOS and in beta on Android. We've opened up the beta list for Android (form) as well as our ReaperAI beta. ReaperAI can open pull requests to delete code for you, as well auto-fix issues like unoptimized issues. Check out more info here 🙂.

Sign up for our newsletter 🛸

Never miss a post or product update



2024 © Emerge Tools, Inc. All rights reserved.