Skip to content

Conversation

@Garzas
Copy link
Contributor

@Garzas Garzas commented Dec 3, 2025

SpikeWPB-21750 [Android] Investigate performance improvements for loading conversation list on clients with a lot of history and in general


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

  • Rendering the conversation list caused long initial frame times on older Android devices.
  • Markdown parsing was executed during recomposition inside LastMessageSubtitle.
  • CommonMark parser and InlineParser were visible in measure and recompose in the profiler.
  • Initial paging load was too large, causing heavy mapper work at startup.
  • Search flow could block on first collect due to missing onStart.

Causes

  • LastMessageSubtitle called toMarkdownDocument and getFirstInlines for every recomposition.
  • Markdown parsing is CPU heavy and should never run on the UI thread.
  • UILastMessageContent did not store any precomputed markdown representation.
  • LazyPagingConfig loaded 60 items on first load, causing unnecessary work.
  • A flow in the view model suspended until initial value, delaying recomposition.

Solutions

  • Added markdownPreview field to UILastMessageContent.TextMessage and SenderWithMessage.
  • Precomputed MarkdownPreview inside mappers using UIText.toMarkdownPreviewOrNull.
  • LastMessageSubtitle now prefers the provided markdownPreview and falls back only when null.
  • This ensures no markdown parsing happens inside Compose.
  • Reduced initial paging load size from 60 to 40 to reduce mapper pressure on first frame.
  • Added onStart to isSelfUserUnderLegalHoldFlow to avoid delaying combine.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

@Garzas looks like you are rolling back kalium to a previous commitish.

This means that the PR's target branch (develop) is using a newer version of Kalium, and the changes in this PR will rollback Kalium to an older version.

develop This PR
a7dbd73f9efcd1b2d0322cf113f1d46fe0209d8d e520bb68d7abe5b8d2e82afd4f8f4f5141fd704e

Is this intentional?

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 3, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants