status-im / status-mobile

a free (libre) open source, mobile OS for Ethereum
https://status.app
Mozilla Public License 2.0
3.92k stars 984 forks source link

perf: Optimize messenger initialization #21642

Open ilmotta opened 5 days ago

ilmotta commented 5 days ago

Fixes https://github.com/status-im/status-mobile/issues/21456

Summary

This PR integrates the optimizations coming from the status-go PR https://github.com/status-im/status-go/pull/6106. Now messenger filters are set-up concurrently and we can call the endpoint wakuext_chatsPreview twice: once for non-community chats and once for community chats. This way, the user should be able to see some data render before the slow part ends (community-related data). All the hard work is in status-go and executed by @qfrank

Areas that may be impacted

Steps to test

We need to check two cases for regression (functional and non-functional):

  1. You login with a profile with many contacts, chats, opened/joined communities, notifications, etc. If you see all the data after login there's no functional regression.

  2. Login with a profile with loads of data and roughly compare the time to see data arrive at different screens (contacts, opened/joined communities, etc) compared to develop. In theory, non-community data (e.g. 1:1 chats) can now arrive earlier and doesn't need to wait for the longer times to set-up filters related to community chats. Whichever call to status-go returns first will immediately trigger the client code to render the data.

I already superficially tested both cases, but more extensive QA would be good.

status: ready

status-im-auto commented 5 days ago

Jenkins Builds

Click to see older builds (4) | :grey_question: | Commit | :hash: | Finished (UTC) | Duration | Platform | Result | |-|-|-|-|-|-|-| | :x: | 7b4c80ac | [#1](https://ci.status.im/job/status-mobile/job/prs/job/android-e2e/job/PR-21642/1/) | 2024-11-20 02:01:25 | ~5 min | `android-e2e` | [:page_facing_up:`log`](https://ci.status.im/job/status-mobile/job/prs/job/android-e2e/job/PR-21642/1/consoleText) | | :heavy_check_mark: | 7b4c80ac | [#1](https://ci.status.im/job/status-mobile/job/prs/job/tests/job/PR-21642/1/) | 2024-11-20 02:01:31 | ~5 min | `tests` | [:page_facing_up:`log`](https://status-im-mobile-prs.ams3.cdn.digitaloceanspaces.com/StatusIm-Mobile-241120-015619-7b4c80-pr21642-tests.log) | | :x: | 7b4c80ac | [#1](https://ci.status.im/job/status-mobile/job/prs/job/android/job/PR-21642/1/) | 2024-11-20 02:02:24 | ~6 min | `android` | [:page_facing_up:`log`](https://ci.status.im/job/status-mobile/job/prs/job/android/job/PR-21642/1/consoleText) | | :x: | 7b4c80ac | [#1](https://ci.status.im/job/status-mobile/job/prs/job/ios/job/PR-21642/1/) | 2024-11-20 02:05:13 | ~8 min | `ios` | [:page_facing_up:`log`](https://ci.status.im/job/status-mobile/job/prs/job/ios/job/PR-21642/1/consoleText) |
:grey_question: Commit :hash: Finished (UTC) Duration Platform Result
:heavy_check_mark: b71f7891 #2 2024-11-22 02:47:14 ~5 min tests :page_facing_up:log
:heavy_check_mark: b71f7891 #2 2024-11-22 02:50:10 ~8 min android-e2e :robot:apk :calling:
:heavy_check_mark: b71f7891 #2 2024-11-22 02:51:27 ~9 min android :robot:apk :calling:
:heavy_check_mark: b71f7891 #2 2024-11-22 02:52:07 ~10 min ios :iphone:ipa :calling:
:heavy_check_mark: 313d8776 #4 2024-11-22 11:54:22 ~5 min tests :page_facing_up:log
:heavy_check_mark: 313d8776 #4 2024-11-22 11:56:41 ~7 min android-e2e :robot:apk :calling:
:heavy_check_mark: 313d8776 #4 2024-11-22 11:59:23 ~10 min android :robot:apk :calling:
:heavy_check_mark: 313d8776 #4 2024-11-22 12:00:07 ~11 min ios :iphone:ipa :calling: