| 28 | }) |
| 29 | |
| 30 | async function measure<T>( |
| 31 | label: string, |
| 32 | detail: Record<string, unknown>, |
| 33 | fn: () => Promise<T> |
| 34 | ): Promise<{ value: T; durationMs: number }> { |
| 35 | const startedAt = performance.now() |
| 36 | const value = await fn() |
| 37 | const durationMs = Math.round((performance.now() - startedAt) * 100) / 100 |
| 38 | console.info(`[zen:bench] ${label} ${durationMs.toFixed(2)}ms`, detail) |
| 39 | return { value, durationMs } |
| 40 | } |
| 41 | |
| 42 | async function seedLargeVault(root: string): Promise<void> { |
| 43 | await ensureVaultLayout(root) |