openclaw - 💡(How to fix) Fix [Performance]: Windows CLI startup takes 120+ seconds - plugin discovery cache ineffective across processes [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#71789Fetched 2026-04-26 05:08:19
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Participants

Root Cause

Root Cause:

RAW_BUFFERClick to expand / collapse

Problem:

CLI commands (openclaw status, etc.) take 118-124 seconds to start on Windows.

Root Cause:

The plugin discovery cache is in-memory only (const discoveryCache = new Map()). Each CLI invocation is a new Node.js process, so the cache is always empty on startup. The DEFAULT_DISCOVERY_CACHE_MS = 1000 (1 second) is also ineffective because:

  1. Each CLI process starts fresh with an empty cache
  2. Plugin discovery takes 15-20 seconds (scanning 6+ directories, 62,000+ filesystem calls on Windows)
  3. The cache expires after 1 second within the same process

Additionally, PR #69925 (jiti native loading optimization) explicitly excludes Windows via shouldPreferNativeJiti():

return !isWin32 && !isBun && isJsExtension(modulePath);

This means Windows users get none of the startup performance improvements from recent PRs.

Evidence:

  • Issue #67040 proposes persisting plugin discovery cache to disk
  • Issue #67869 reports 85-second event loop blocks on Windows with 102+ bundled extensions
  • Issue #48380 reports O(NxM) reloads during gateway startup

Impact:

  • Every CLI command takes 118-124 seconds on Windows
  • Gateway startup takes even longer with multiple agents
  • Linux/macOS users got 50-80% speedup from recent PRs, Windows users got 0%

Steps to Reproduce:

  1. Install OpenClaw on Windows
  2. Run openclaw status
  3. Observe 118-124 second startup time

Expected Behavior:

CLI startup should be under 15-20 seconds on Windows, similar to Linux/macOS after the recent optimizations.

Environment:

  • OS: Windows 10
  • OpenClaw Version: 2026.4.15
  • Node.js: v24.14.0
  • Number of plugins: 19

extent analysis

TL;DR

Implementing a persistent plugin discovery cache, as proposed in Issue #67040, is likely to significantly reduce the startup time of CLI commands on Windows.

Guidance

  • Investigate the feasibility of persisting the plugin discovery cache to disk, as this would allow the cache to be shared across multiple CLI invocations and reduce the startup time.
  • Review the shouldPreferNativeJiti() function to determine if there are any potential modifications that could enable the native loading optimization for Windows users.
  • Consider increasing the DEFAULT_DISCOVERY_CACHE_MS value to a higher number, such as 60 seconds or more, to reduce the frequency of plugin discovery scans.
  • Evaluate the performance impact of the 62,000+ filesystem calls on Windows and explore potential optimizations, such as caching or batching.

Example

No code example is provided as it would require modifications to the existing OpenClaw codebase, which is not explicitly stated in the issue.

Notes

The proposed solution relies on the assumption that persisting the plugin discovery cache to disk will significantly reduce the startup time. However, the actual performance gain may vary depending on the specific use case and environment.

Recommendation

Apply a workaround by implementing a persistent plugin discovery cache, as this is likely to provide the most significant performance improvement for Windows users.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING