From 35592be6e90e4f014a7604a224761f2015d976b7 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Mon, 10 Mar 2025 16:46:48 -0700 Subject: [PATCH] time walkdir --- core/indexing/walkDir.ts | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/core/indexing/walkDir.ts b/core/indexing/walkDir.ts index 757163d96..d876425b3 100644 --- a/core/indexing/walkDir.ts +++ b/core/indexing/walkDir.ts @@ -157,6 +157,17 @@ const defaultOptions: WalkerOptions = { returnRelativeUrisPaths: false, }; +export async function* walkDirAsync( + path: string, + ide: IDE, + _optionOverrides?: WalkerOptions, +): AsyncGenerator { + const start = Date.now(); + const options = { ...defaultOptions, ..._optionOverrides }; + yield* new DFSWalker(path, ide, options).walk(); + console.log(`walkDir took ${Date.now() - start}ms`); +} + export async function walkDir( uri: string, ide: IDE, @@ -169,15 +180,6 @@ export async function walkDir( return urisOrRelativePaths; } -export async function* walkDirAsync( - path: string, - ide: IDE, - _optionOverrides?: WalkerOptions, -): AsyncGenerator { - const options = { ...defaultOptions, ..._optionOverrides }; - yield* new DFSWalker(path, ide, options).walk(); -} - export async function walkDirs( ide: IDE, _optionOverrides?: WalkerOptions,