mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-07-09 17:19:02 +00:00
perf(cli): enable compile cache and defer getCliVersion for serve (#5938)
Enable Node.js compile cache (module.enableCompileCache) in the serve fast-path so V8 bytecode is cached across daemon restarts. Start getCliVersion() as a non-blocking promise and resolve it in parallel with the runtime module loads inside buildRuntime(), removing it from the pre-listen critical path.
This commit is contained in:
parent
865581b559
commit
a93ec674e9
3 changed files with 18 additions and 8 deletions
|
|
@ -19,6 +19,7 @@
|
|||
* independently add --expose-gc via spawnChannel.ts.
|
||||
*/
|
||||
|
||||
import module from 'node:module';
|
||||
import { spawnSync } from 'node:child_process';
|
||||
import { fileURLToPath, pathToFileURL } from 'node:url';
|
||||
import { dirname, join } from 'node:path';
|
||||
|
|
@ -31,6 +32,7 @@ function isServeCommand() {
|
|||
}
|
||||
|
||||
if (isServeCommand()) {
|
||||
module.enableCompileCache?.();
|
||||
process.argv[1] = cliPath;
|
||||
await import(pathToFileURL(cliPath).href);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue