Describe the bug
There is a severe performance bottleneck during CLI startup (openclaw status, openclaw tasks list, etc.), causing delays of 11s+ on Linux and up to 25s+ on Windows (NTFS).
Through deep CPU profiling (NODE_OPTIONS="--cpu-prof"), we have identified that the delay is not network-related, but stems from extreme CPU/IO overhead in the Plugin Loader's interaction with jiti.
To Reproduce
- Run
time openclaw status on a Windows machine or a Linux machine with a few plugins (like lossless-claw) in ~/.openclaw/extensions/.
- Observe the 15s-25s startup time.
- Profile it:
NODE_OPTIONS="--cpu-prof" openclaw status.
Root Cause Analysis
The CPU profile reveals that jiti and the OpenClaw SDK loader spend massive amounts of time doing global filesystem traversal and alias normalization on every startup:
2479 ticks - normalizeAliases file:///.../jiti.cjs
1162 ticks - get exports node:internal/modules/package_json_reader
1087 ticks - get exports ... (without plugin)
984 ticks - parsePackageName
194 ticks - buildPluginLoaderAliasMap
160 ticks - loadPluginManifest
Because plugins use virtual paths like openclaw/plugin-sdk/*, the CLI loader builds a massive Alias Map. jiti then aggressively intercepts and string-matches these aliases, parsing package.json files repeatedly across the filesystem. Pre-compiling plugins to .js locally does not bypass this, as jiti still intercepts the runtime execution.
Expected behavior
CLI startup should be near-instant. The loadPluginManifest and buildPluginLoaderAliasMap need persistent caching across CLI runs, or jiti interception needs a fast-path that avoids recursive filesystem IO on static plugin trees.
Reported by: Jimmy & Ops-Pro
Describe the bug
There is a severe performance bottleneck during CLI startup (
openclaw status,openclaw tasks list, etc.), causing delays of 11s+ on Linux and up to 25s+ on Windows (NTFS).Through deep CPU profiling (
NODE_OPTIONS="--cpu-prof"), we have identified that the delay is not network-related, but stems from extreme CPU/IO overhead in the Plugin Loader's interaction withjiti.To Reproduce
time openclaw statuson a Windows machine or a Linux machine with a few plugins (likelossless-claw) in~/.openclaw/extensions/.NODE_OPTIONS="--cpu-prof" openclaw status.Root Cause Analysis
The CPU profile reveals that
jitiand the OpenClaw SDK loader spend massive amounts of time doing global filesystem traversal and alias normalization on every startup:Because plugins use virtual paths like
openclaw/plugin-sdk/*, the CLI loader builds a massive Alias Map.jitithen aggressively intercepts and string-matches these aliases, parsingpackage.jsonfiles repeatedly across the filesystem. Pre-compiling plugins to.jslocally does not bypass this, asjitistill intercepts the runtime execution.Expected behavior
CLI startup should be near-instant. The
loadPluginManifestandbuildPluginLoaderAliasMapneed persistent caching across CLI runs, orjitiinterception needs a fast-path that avoids recursive filesystem IO on static plugin trees.Reported by: Jimmy & Ops-Pro