perf(ledger): short-circuit command kind checks (#187)

* perf: eliminate redundant CommandLedger lookups in command loops

Avoid calling CommandLedger.find inside loops over command sources in
retireStaleAccountCommands and AccountRequests.isLoading by providing
CommandLedger.entriesOfKind which returns source names and descriptors in a
single pass. Also optimize CommandLedger.hasKind to short-circuit on match.

Co-authored-by: Lucenx9 <185146821+Lucenx9@users.noreply.github.com>

* perf(ledger): optimize CommandLedger entry lookups in account command loops

Avoid calling CommandLedger.find inside loops over command sources in
retireStaleAccountCommands and AccountRequests.isLoading by providing
CommandLedger.entriesOfKind which returns source names and descriptors in a
single pass. Also optimize CommandLedger.hasKind to short-circuit on match.

Co-authored-by: Lucenx9 <185146821+Lucenx9@users.noreply.github.com>

* perf(ledger): optimize CommandLedger entry lookups in account command loops

Avoid calling CommandLedger.find inside loops over command sources in
retireStaleAccountCommands and AccountRequests.isLoading by providing
CommandLedger.entriesOfKind which returns source names and descriptors in a
single pass. Also optimize CommandLedger.hasKind to short-circuit on match.

Co-authored-by: Lucenx9 <185146821+Lucenx9@users.noreply.github.com>

* perf(ledger): keep only short-circuit kind checks

Drop the entriesOfKind API and account caller changes after Qt measurements showed no consistent benefit. Preserve hasKind filtering and exact matching with adversarial tests. Documentation, configuration, translations and TODO are unchanged because this is an internal query optimization. Strict make check passed in the pinned KDE neon environment.

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Lucenx9 <185146821+Lucenx9@users.noreply.github.com>
1bb7d7929eSimone committed on 9/9/2026, 1:59:15 PM· committed by GitHubparenta2db657
2 files changedLine totals unavailable