Parallelism with Android SQLiteThe SQLDelight documentation provides this example: val players: Flow<List<HockeyPlayer>> = playerQueries.selectAll() .asFlow() .mapToList(Dispatchers.IO) This looks reasonable, right? In the Square Point Of Sale application, we recently ...Feb 5, 2025·11 min read
ANR internals: touch dispatching through the view hierarchyI'm writing a blog series on ANR internals, where I'll use ANRs as an excuse to learn more about how various parts of Android work. This first article is focused on touch dispatching through the view hierarchy. ANR triggers How is an "Application No...Sep 14, 2023·4 min read
A script to compare two Macrobenchmarks runsIn Statistically Rigorous Android Macrobenchmarks, I laid out a methodology for rigorously comparing the outcome of two Jetpack Macrobenchmark runs. To summarize the article: Remove sources of variations until the distribution fits a normal distribu...Sep 7, 2023·2 min read
Freezes & ANRs? Check memory leaks!In this article, I show how Android memory leaks lead to jank, freezes and ANRs more often than they lead to OutOfMemoryError crashes. Navigation Latency At Square, we've been tracking a User-Centric performance metric: Interaction Latency. We track ...Jul 20, 2023·4 min read
Tracking Android App Launch in production👋 In this article, I summarize my findings on Android app launch after a few years of deep dives, with the hope that these guidelines help implementations track app launches correctly. User-Centric App Launch analytics In User-Centric Mobile Perfor...Jul 13, 2023·8 min read
User-Centric Mobile Performance👋 Hi, this is P-Y, over the last three years I've been steering Square's focus on mobile performance and building a framework for thinking about it and prioritizing work. In this article I share my approach, let me know what you think! Useful metri...Jul 6, 2023·11 min read
Avoid Java double brace initializationTL;DR Avoid doing this: new HashMap<String, String>() {{ put("key", value); }}; Leak Trace I was recently looking at the following leak trace from LeakCanary: ┬─── │ GC Root: Global variable in native code │ ├─ com.bugsnag.android.AnrPlugin instan...Jun 27, 2023·4 min read