Skip to content

perf: parallel file discovery and external CLI caching#501

Merged
jackwener merged 1 commit intomainfrom
perf/parallel-discovery-and-cache
Mar 27, 2026
Merged

perf: parallel file discovery and external CLI caching#501
jackwener merged 1 commit intomainfrom
perf/parallel-discovery-and-cache

Conversation

@jackwener
Copy link
Copy Markdown
Owner

Summary

  • Parallelize file scanning in discoverClisFromFs and discoverPluginDirisCliModule checks now run concurrently via Promise.all(files.map(async ...)) instead of serial for-of with await
  • Parallelize plugin directory scanning in discoverPlugins
  • Cache loadExternalClis() result to avoid re-parsing YAML on repeated calls, with proper invalidation in registerExternalCli
  • Cache strategyLabel() call in list command

Test plan

  • tsc --noEmit passes
  • 568/569 tests pass (1 flaky e2e network test)
  • No semantic change: plugin override order preserved (sequential discovery kept intentionally)

- Parallelize file scanning in discoverClisFromFs and discoverPluginDir
  using Promise.all(files.map(async ...)) instead of serial for-of with
  await, so isCliModule checks run concurrently
- Parallelize plugin directory scanning in discoverPlugins
- Cache loadExternalClis() result to avoid re-parsing YAML on every call
- Invalidate cache in registerExternalCli after writing to disk
- Cache strategyLabel() call in list command to avoid redundant computation
- Add comment explaining why discovery must remain sequential (plugin override semantics)
@jackwener jackwener force-pushed the perf/parallel-discovery-and-cache branch from d018408 to 4968c2e Compare March 27, 2026 06:15
@jackwener jackwener merged commit 31cb229 into main Mar 27, 2026
23 checks passed
@jackwener jackwener deleted the perf/parallel-discovery-and-cache branch March 27, 2026 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant