History

Document perf toggle and benchmark pass resolution semantics

Cursor Agent committed 8 months ago

Commit a85be011 parent e425db61 file · +11 −0Browse files

Unified · Split

apps/desktop/src/perfConfig.ts+11−0
@@ -20,6 +20,7 @@ type BenchmarkSweepToggleEnv = { · 19 unmodified lines
2020
2121 const TRUE_VALUES = new Set(["1", "true", "yes", "on"]);
2222 const FALSE_VALUES = new Set(["0", "false", "no", "off"]);
23+// Avoid pathological workload from misconfigured env overrides in CI.
2324 const MAX_BENCHMARK_FOLLOW_UP_PASSES = 5;
2425
2526 function parseBooleanLike(value: string | undefined): boolean | null {
@@ -59,10 +60,20 @@ export function shouldRunOptionalRendererPerfInteractions(env: OptionalRendererT · 33 unmodified lines
5960 return resolveBooleanToggle(env.T3CODE_DESKTOP_PERF_RUN_OPTIONAL_RENDERER, env.CI);
6061 }
6162
63+/**
64+ * Controls high-variance benchmark thread switching loops.
65+ * Defaults off in CI, on locally, with explicit env override support.
66+ */
6267 export function shouldRunBenchmarkThreadSweep(env: BenchmarkSweepToggleEnv): boolean {
6368 return resolveBooleanToggle(env.T3CODE_DESKTOP_PERF_RUN_BENCHMARK_SWEEP, env.CI);
6469 }
6570
71+/**
72+ * Resolves number of follow-up benchmark passes.
73+ * - explicit non-negative integer env override wins
74+ * - value is capped for safety
75+ * - otherwise defaults to 0 in CI and 1 locally
76+ */
6677 export function resolveBenchmarkFollowUpPassCount(env: PerfBenchmarkEnv): number {
6778 const raw = env.T3CODE_DESKTOP_PERF_BENCHMARK_FOLLOW_UP_PASSES?.trim();
6879 if (raw && /^\d+$/.test(raw)) {