Skip to content

Commit 327e6b7

Browse files
committed
perf(search): search up to eight live accounts at once
A live search waits for every account before fusing results, and accounts ran four at a time, so an organization with five to eight connected accounts paid a second full provider round trip on every unscoped search. Production seven-account searches took about 2.1 s at p50 against about 0.6 s for one account. Each account is a single provider call, so eight at once stays well inside provider and token-refresh limits.
1 parent 9d8e4d8 commit 327e6b7

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎apps/sim/lib/sim-search/live/application.ts‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,12 @@ function resultFor(
261261
}
262262
}
263263

264-
/** Accounts searched at once; bounds token refresh and provider fan-out in large organizations. */
265-
const ACCOUNT_CONCURRENCY = 4
264+
/**
265+
* Accounts searched at once; bounds token refresh and provider fan-out in large organizations.
266+
* Each account is one provider, and a search waits for every account, so a second wave adds a
267+
* full provider round trip; eight covers the account count most organizations search.
268+
*/
269+
const ACCOUNT_CONCURRENCY = 8
266270
/** Candidates verified at once; each verification is one or more provider requests. */
267271
const VERIFY_CONCURRENCY = 5
268272
const MAX_ACCOUNTS = 20

0 commit comments

Comments
 (0)