From 41f1daf3e0bd7407628b214d97b61cefe3614bcd Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 23 Mar 2026 21:23:33 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=20Bolt:=20[performance=20improvement]?= =?UTF-8?q?=20concurrent=20stats=20fetching?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refactored `getStats` in `src/lib/server/index.ts` to fetch `domainCount`, `ownerCount`, and `recentDomains` concurrently using `Promise.all` rather than awaiting them sequentially. This eliminates an unnecessary waterfall, dropping the response latency to be bounded purely by the single slowest asynchronous call. Co-authored-by: yeboster <23556525+yeboster@users.noreply.github.com> --- src/lib/server/index.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/lib/server/index.ts b/src/lib/server/index.ts index d87bacec..def84dfd 100644 --- a/src/lib/server/index.ts +++ b/src/lib/server/index.ts @@ -44,11 +44,12 @@ export interface DomainStats { } export const getStats = async (): Promise => { - const domainCount = await metaNamesSdk.domainRepository.count(); - const ownerCount = await metaNamesSdk.domainRepository - .getOwners() - .then((owners) => owners.length); - const recentDomains = await getRecentDomains(); + // ⚡ Bolt: Execute independent queries concurrently to avoid waterfall latency + const [domainCount, ownerCount, recentDomains] = await Promise.all([ + metaNamesSdk.domainRepository.count(), + metaNamesSdk.domainRepository.getOwners().then((owners) => owners.length), + getRecentDomains() + ]); return { domainCount,