The splash screen ("Heating up", src/app/pages/client/ClientLoading.tsx) is held until the chats are populated, then a further fixed delay. The causes, read from ClientRoot.tsx and initMatrix.ts:
Nothing paints until initClient resolves.src/client/initMatrix.ts:124 awaits indexedDBStore.startup(), then :126 awaits mx.initRustCrypto(). The wasm module is 5.5 MB (node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.wasm). mx is undefined until both finish, so the splash shows only a spinner — no spaces, no chats. Crypto is not needed to render the room list.
chatsReady requires directsAtom.size > 0 (ClientRoot.tsx:187). An account with no direct chats never satisfies it, so it always waits the 10000 ms deadline at :285. A fresh install with an empty store does the same.
Fixed 1500 ms hold after readiness (:177), purely so the particle animation finishes. Even with a warm cache the splash adds 1.5 s.
5000 ms grace when Prepared comes from cache (:341). If the store restores rooms but not m.direct, the splash waits the whole grace.
400 ms poll (:288) on top of the ClientEvent.Room and ClientEvent.AccountData listeners that already exist. It only adds latency.
The first network sync fetches the whole room list:startClient({ lazyLoadMembers: true }) at initMatrix.ts:172, no initial sync limit, no sliding sync anywhere in src.
Worst case is initClient + 10000 ms deadline + 1500 ms hold, plus the network sync. Best case with a warm cache is initClient + 1500 ms.
What can be done, ranked by impact:
Gate the hide on rooms only and drop the directsAtom.size > 0 requirement. This removes the 10 s deadline for accounts with no DMs.
Move initRustCrypto() off the awaited path: paint the room list from the store and initialise crypto in the background. Biggest structural win. The cost is that encrypted rooms show undecrypted content until crypto is ready, so it needs a decision about what those rooms display in the meantime.
Shorten or remove the 1500 ms animation hold, or run the animation in the real UI instead of the splash.
Shorten the 5000 ms cache grace.
Drop the 400 ms interval and rely on the existing event listeners.
The numbers 1500, 5000, 10000, and 400 ms are fixed regardless of the account. The first two items are the only ones that change the perceived time for a normal warm-cache load. These timings are read from the code, not measured in a browser.
The splash screen ("Heating up", `src/app/pages/client/ClientLoading.tsx`) is held until the chats are populated, then a further fixed delay. The causes, read from `ClientRoot.tsx` and `initMatrix.ts`:
1. **Nothing paints until `initClient` resolves.** `src/client/initMatrix.ts:124` awaits `indexedDBStore.startup()`, then `:126` awaits `mx.initRustCrypto()`. The wasm module is 5.5 MB (`node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.wasm`). `mx` is undefined until both finish, so the splash shows only a spinner — no spaces, no chats. Crypto is not needed to render the room list.
2. **`chatsReady` requires `directsAtom.size > 0`** (`ClientRoot.tsx:187`). An account with no direct chats never satisfies it, so it always waits the 10000 ms deadline at `:285`. A fresh install with an empty store does the same.
3. **Fixed 1500 ms hold after readiness** (`:177`), purely so the particle animation finishes. Even with a warm cache the splash adds 1.5 s.
4. **5000 ms grace when `Prepared` comes from cache** (`:341`). If the store restores rooms but not `m.direct`, the splash waits the whole grace.
5. **400 ms poll** (`:288`) on top of the `ClientEvent.Room` and `ClientEvent.AccountData` listeners that already exist. It only adds latency.
6. **The first network sync fetches the whole room list:** `startClient({ lazyLoadMembers: true })` at `initMatrix.ts:172`, no initial sync limit, no sliding sync anywhere in `src`.
Worst case is `initClient` + 10000 ms deadline + 1500 ms hold, plus the network sync. Best case with a warm cache is `initClient` + 1500 ms.
What can be done, ranked by impact:
- **Gate the hide on rooms only and drop the `directsAtom.size > 0` requirement.** This removes the 10 s deadline for accounts with no DMs.
- **Move `initRustCrypto()` off the awaited path:** paint the room list from the store and initialise crypto in the background. Biggest structural win. The cost is that encrypted rooms show undecrypted content until crypto is ready, so it needs a decision about what those rooms display in the meantime.
- **Shorten or remove the 1500 ms animation hold**, or run the animation in the real UI instead of the splash.
- **Shorten the 5000 ms cache grace.**
- **Drop the 400 ms interval** and rely on the existing event listeners.
The numbers 1500, 5000, 10000, and 400 ms are fixed regardless of the account. The first two items are the only ones that change the perceived time for a normal warm-cache load. These timings are read from the code, not measured in a browser.
Measured with headless Chromium against a stub homeserver, production build served statically, single account.
Cold first load (empty stores)
Phase
Time
Bundle fetch + eval to first app code
1300 ms (9.6 MB bundle, 209 ms fetch)
indexedDBStore.startup()
18-31 ms
mx.initRustCrypto()
174-232 ms
First sync to Prepared
~600 ms after init (stub answers instantly)
Splash hide scheduled
~1600 ms
UI actually swaps in
~3100 ms (the fixed 1500 ms hold)
Warm reload, 500 rooms persisted
Phase
Time
Bundle eval
~500 ms
indexedDBStore.startup()
36 ms
mx.initRustCrypto()
121 ms
Rooms in the atom
~666 ms
Splash hide
10000 ms — the deadline, because chatsReady needs directsAtom.size > 0 and this account has no m.direct
The dev server is much worse for the first phase (3.8 s cold, 2.6 s warm) because it serves unbundled modules.
What initRustCrypto actually does per load (matrix-js-sdk 41.9.0, src/rust-crypto/index.ts:38):
RustSdkCryptoJs.initAsync() — fetch and compile the 5.57 MB wasm. Measured: 69 ms fetch cold, 29 ms from cache, 63 ms compile cold, 10-13 ms warm.
StoreHandle.open(storePrefix, passphrase) — opens the crypto IndexedDB.
migrateFromLegacyCrypto — runs on every load because cryptoStore is passed to createClient at initMatrix.ts:116. legacyStore.containsData() opens crypto@<user>@<device> even when that store was never used.
On caching: there is nothing left to cache. The crypto store is already persisted in IndexedDB, the wasm bytes are already served from the HTTP cache and the PWA service worker, and the wasm module is already cached within a page load — repeated initClient calls in the same page cost 385, 385, 275 ms, so the wasm init is not repeated. What repeats on every load is the wasm compile, the crypto store open, and the legacy-store check: about 120 ms warm.
The wins are not caching:
Do not block the first paint on initRustCrypto. It is not needed to render the room list.
Skip the legacy-store check when that store has no data. It needs a decision, because accounts that used legacy crypto still need the migration path.
Fix the chatsReady gate so an account with no direct chats does not wait the full 10 s deadline.
Shorten the fixed 1500 ms animation hold.
The store startup number scales with the number of persisted events, so a real account with tens of thousands of events will be slower than the 36 ms measured here. The first network sync is homeserver-bound and is not covered by these numbers.
Measured with headless Chromium against a stub homeserver, production build served statically, single account.
**Cold first load (empty stores)**
| Phase | Time |
| --- | --- |
| Bundle fetch + eval to first app code | 1300 ms (9.6 MB bundle, 209 ms fetch) |
| `indexedDBStore.startup()` | 18-31 ms |
| `mx.initRustCrypto()` | 174-232 ms |
| First sync to `Prepared` | ~600 ms after init (stub answers instantly) |
| Splash hide scheduled | ~1600 ms |
| UI actually swaps in | ~3100 ms (the fixed 1500 ms hold) |
**Warm reload, 500 rooms persisted**
| Phase | Time |
| --- | --- |
| Bundle eval | ~500 ms |
| `indexedDBStore.startup()` | 36 ms |
| `mx.initRustCrypto()` | 121 ms |
| Rooms in the atom | ~666 ms |
| Splash hide | 10000 ms — the deadline, because `chatsReady` needs `directsAtom.size > 0` and this account has no `m.direct` |
The dev server is much worse for the first phase (3.8 s cold, 2.6 s warm) because it serves unbundled modules.
**What `initRustCrypto` actually does per load** (matrix-js-sdk 41.9.0, `src/rust-crypto/index.ts:38`):
1. `RustSdkCryptoJs.initAsync()` — fetch and compile the 5.57 MB wasm. Measured: 69 ms fetch cold, 29 ms from cache, 63 ms compile cold, 10-13 ms warm.
2. `StoreHandle.open(storePrefix, passphrase)` — opens the crypto IndexedDB.
3. `migrateFromLegacyCrypto` — runs on every load because `cryptoStore` is passed to `createClient` at `initMatrix.ts:116`. `legacyStore.containsData()` opens `crypto@<user>@<device>` even when that store was never used.
**On caching:** there is nothing left to cache. The crypto store is already persisted in IndexedDB, the wasm bytes are already served from the HTTP cache and the PWA service worker, and the wasm module is already cached within a page load — repeated `initClient` calls in the same page cost 385, 385, 275 ms, so the wasm init is not repeated. What repeats on every load is the wasm compile, the crypto store open, and the legacy-store check: about 120 ms warm.
The wins are not caching:
- Do not block the first paint on `initRustCrypto`. It is not needed to render the room list.
- Skip the legacy-store check when that store has no data. It needs a decision, because accounts that used legacy crypto still need the migration path.
- Fix the `chatsReady` gate so an account with no direct chats does not wait the full 10 s deadline.
- Shorten the fixed 1500 ms animation hold.
The store startup number scales with the number of persisted events, so a real account with tens of thousands of events will be slower than the 36 ms measured here. The first network sync is homeserver-bound and is not covered by these numbers.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The splash screen ("Heating up",
src/app/pages/client/ClientLoading.tsx) is held until the chats are populated, then a further fixed delay. The causes, read fromClientRoot.tsxandinitMatrix.ts:initClientresolves.src/client/initMatrix.ts:124awaitsindexedDBStore.startup(), then:126awaitsmx.initRustCrypto(). The wasm module is 5.5 MB (node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.wasm).mxis undefined until both finish, so the splash shows only a spinner — no spaces, no chats. Crypto is not needed to render the room list.chatsReadyrequiresdirectsAtom.size > 0(ClientRoot.tsx:187). An account with no direct chats never satisfies it, so it always waits the 10000 ms deadline at:285. A fresh install with an empty store does the same.:177), purely so the particle animation finishes. Even with a warm cache the splash adds 1.5 s.Preparedcomes from cache (:341). If the store restores rooms but notm.direct, the splash waits the whole grace.:288) on top of theClientEvent.RoomandClientEvent.AccountDatalisteners that already exist. It only adds latency.startClient({ lazyLoadMembers: true })atinitMatrix.ts:172, no initial sync limit, no sliding sync anywhere insrc.Worst case is
initClient+ 10000 ms deadline + 1500 ms hold, plus the network sync. Best case with a warm cache isinitClient+ 1500 ms.What can be done, ranked by impact:
directsAtom.size > 0requirement. This removes the 10 s deadline for accounts with no DMs.initRustCrypto()off the awaited path: paint the room list from the store and initialise crypto in the background. Biggest structural win. The cost is that encrypted rooms show undecrypted content until crypto is ready, so it needs a decision about what those rooms display in the meantime.The numbers 1500, 5000, 10000, and 400 ms are fixed regardless of the account. The first two items are the only ones that change the perceived time for a normal warm-cache load. These timings are read from the code, not measured in a browser.
Measured with headless Chromium against a stub homeserver, production build served statically, single account.
Cold first load (empty stores)
indexedDBStore.startup()mx.initRustCrypto()PreparedWarm reload, 500 rooms persisted
indexedDBStore.startup()mx.initRustCrypto()chatsReadyneedsdirectsAtom.size > 0and this account has nom.directThe dev server is much worse for the first phase (3.8 s cold, 2.6 s warm) because it serves unbundled modules.
What
initRustCryptoactually does per load (matrix-js-sdk 41.9.0,src/rust-crypto/index.ts:38):RustSdkCryptoJs.initAsync()— fetch and compile the 5.57 MB wasm. Measured: 69 ms fetch cold, 29 ms from cache, 63 ms compile cold, 10-13 ms warm.StoreHandle.open(storePrefix, passphrase)— opens the crypto IndexedDB.migrateFromLegacyCrypto— runs on every load becausecryptoStoreis passed tocreateClientatinitMatrix.ts:116.legacyStore.containsData()openscrypto@<user>@<device>even when that store was never used.On caching: there is nothing left to cache. The crypto store is already persisted in IndexedDB, the wasm bytes are already served from the HTTP cache and the PWA service worker, and the wasm module is already cached within a page load — repeated
initClientcalls in the same page cost 385, 385, 275 ms, so the wasm init is not repeated. What repeats on every load is the wasm compile, the crypto store open, and the legacy-store check: about 120 ms warm.The wins are not caching:
initRustCrypto. It is not needed to render the room list.chatsReadygate so an account with no direct chats does not wait the full 10 s deadline.The store startup number scales with the number of persisted events, so a real account with tens of thousands of events will be slower than the 36 ms measured here. The first network sync is homeserver-bound and is not covered by these numbers.