From 553bf671efd73d118a0bfc94fd2cb3d867cd2b69 Mon Sep 17 00:00:00 2001 From: DoSun Date: Wed, 20 May 2026 17:03:35 +0800 Subject: [PATCH] perf: optimize cs-cloud spawn performance and remove debug logging Optimized the spawn call to match direct cs-cloud execution performance: - Use process.env directly instead of spreading (avoids unnecessary copy) - Explicitly disable shell to avoid overhead - Removed debug timestamp logging for cleaner output The spawn performance now matches direct cs-cloud binary execution. Co-Authored-By: claude-sonnet-4-6 --- src/cli/handlers/cloud.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/cli/handlers/cloud.ts b/src/cli/handlers/cloud.ts index 8299a78c6..d8bf79fa6 100644 --- a/src/cli/handlers/cloud.ts +++ b/src/cli/handlers/cloud.ts @@ -232,14 +232,12 @@ function getCloudRawArgs(): string[] { async function runCsCloud(args: string[]): Promise { const bin = await ensureCsCloud() - // Log the command being executed for transparency - console.log(`Executing: ${bin} ${args.join(" ")}`) - - // Close stdin to prevent blocking, inherit stdout/stderr + // Optimize spawn call to match direct execution performance const child = spawn(bin, args, { stdio: ["ignore", "inherit", "inherit"], windowsHide: false, - env: { ...process.env, CSC_CLOUD_INVOKER: "csc" }, + env: process.env, + shell: false, detached: false, })