Skip to content

Performance: N+1 Secure Storage Requests on Sidebar Load #186

Description

@ZhuchkaTriplesix

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:

  1. Run hydration concurrently using Future.wait(rows.map(...)).
  2. 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.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions