Summary of Results

  • Performance Improvement: Home page loading time was reduced by 100ms, an 11% improvement (from ~925ms to ~825ms for the first tweet draw).
  • Ad Revenue Increase: The faster load time led to a 2% increase in ad revenue, as users engaged with the content and saw advertisements sooner.

Background

Social Network X (former Twitter) aimed to enhance the user experience by speeding up the home page loading time upon app start. A faster load time would not only improve user satisfaction but also increase ad revenue by displaying advertisements sooner. The goal was to identify and eliminate any hidden performance bottlenecks that were delaying the home feed loading.

The Challenge

Despite having an optimized sequence of events for home feed loading, users experienced delays that traditional performance tools couldn't pinpoint. The method causing the issue was executed in less than 1ms, making it difficult to detect. Moreover, existing tools lacked visibility into the main thread queue's impact on wait times, leaving a significant performance optimization opportunity unnoticed.

Leveraging PS Tool

By utilizing PS Tool, a performance analysis solution by Product Science, the team gained detailed insights into the app's execution paths and main thread activity. PS Tool revealed delays in the execution path from TwitterListContentViewProvider onListLoadFinished, highlighted by red areas in the trace.

PS Tool highlights the before fix app start execution path that shows the first rescheduling from the main thread.

The Solution

Instead of waiting for ReplayObserver onNext to trigger TabbedChannelsViewPresenter onNext, the team adjusted the scheduling so that TabbedChannelsViewPresenter onNext was triggered directly from within Choreographer (method rendering corresponding UI update).

By eliminating the redundant step, TwitterListContentViewProvider onListLoadFinished was executed approximately 100ms earlier.

PS Tool highlights the before fix app start execution path that shows that the first rescheduling from the main thread has been removed

By utilizing PS Tool, Social Network X uncovered and resolved a subtle yet impactful performance bottleneck that other tools failed to identify. The optimization was straightforward — easy to find and fast to implement, involving the removal of an unnecessary dependency. This change noticeably improved the app's performance and had a significant effect on ad revenue.