Files
Android/app/src/main/java/org/thoughtcrime/securesms
jeffrey-signal 8a057168ae Improve conversation scroll performance.
Fixes a performance bottleneck in `ConversationFragment` caused by expensive calculations in `ConversationItemDecorations.hasHeader()`. This method is invoked in `RecyclerView.ItemDecoration.getItemOffsets()`, which runs on every layout pass and happens frequently during scrolling.

The most expensive calculation in `hasHeader()` is `toEpochDay()`. That method calls `Long.toLocalDate()`, which clones a `TimeZone` object on each call. Upon opening one conversation (without scrolling), I observed that `toEpochDay()` was called over 1000 times in less than a second, rapidly allocating memory and causing garbage collection pressure that potentially leads to ANRs.

We only need to calculate `hasHeader()` once for each conversation element, so caching the result of that method will eliminate the unnecessary calculations and improve the memory usage of `ConversationFragment`.
2025-07-18 16:36:17 -04:00
..
2025-06-04 15:17:36 -04:00
2025-07-10 09:12:48 -03:00
2025-06-26 15:07:39 -04:00
2025-07-16 14:34:50 -04:00
2025-06-09 20:21:06 -04:00
2025-06-26 15:07:39 -04:00
2025-07-10 09:12:48 -03:00
2025-07-16 12:42:35 -04:00