When loading the connections list, LocalDb.instance.getConnections() in local_db.dart performs sequential asynchronous secure storage lookups (ConnectionSecretsStore.readForConnection()) for every connection row in a loop.
On desktop targets (libsecret, Keychain, Credential Manager), each lookup involves system IPC which takes 5ms to 50ms. With many connections, this sequential block causes a noticeable lag when loading the sidebar connections tree.
Steps to fix:
- Run hydration concurrently using
Future.wait(rows.map(...)).
- Even better, implement lazy hydration: retrieve connection rows from the local DB without their passwords/connection strings for sidebar listing, and load these secrets only when a connection is actually selected for activation.
When loading the connections list,
LocalDb.instance.getConnections()in local_db.dart performs sequential asynchronous secure storage lookups (ConnectionSecretsStore.readForConnection()) for every connection row in a loop.On desktop targets (libsecret, Keychain, Credential Manager), each lookup involves system IPC which takes 5ms to 50ms. With many connections, this sequential block causes a noticeable lag when loading the sidebar connections tree.
Steps to fix:
Future.wait(rows.map(...)).