Skip to content

Fix missing tsc.js in command args for non-native tsc benchmarks#121

Merged
jakebailey merged 1 commit intomainfrom
copilot/investigate-ts-go-performance-issue
Apr 19, 2026
Merged

Fix missing tsc.js in command args for non-native tsc benchmarks#121
jakebailey merged 1 commit intomainfrom
copilot/investigate-ts-go-performance-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 19, 2026

Non-tsgo tsc benchmarks fail immediately because tsc.js is never added to the node command line. The resulting command is node --expose-gc -b /path/to/suite/... --diagnostics instead of node --expose-gc /path/to/tsc.js -b /path/to/suite/... --diagnostics.

The tsgo refactor split runCompilerScenario into native (binary is the executable) vs non-native (node is the executable, needs tsc.js as first arg) paths, but the non-native path never adds tsc.js to args.

  • Add .addIf(!nativeBin && !usesPublicApi, tsc) for the benchmark command builder
  • Add .addIf(!nativeBin, tsc) for the clean command builder
const { cmd, args, hasBuild } = new CommandLineArgumentsBuilder(
    expansion,
    nativeBin ? tsc : host,
    /*exposeGc*/ undefined,
    options.cpus,
    options.predictable,
)
    .addIf(!nativeBin && !usesPublicApi, tsc)
    .addIf(usesPublicApi, tscPublicWrapper, typescript)
    .addCompilerOptions(options, scenario)
    .add("--diagnostics");

For comparison, runStartupScenario and runTSServerScenario already correctly add their entry points (.add(entrypoint) and .add(path.join(__dirname, "measuretsserver.js")) respectively).

In runCompilerScenario, when building with a non-native host (e.g.,
node@18.15.0), the path to tsc.js was never added to the command line
arguments. This resulted in running:
  node --expose-gc -b /path/to/suite/... --diagnostics
instead of:
  node --expose-gc /path/to/tsc.js -b /path/to/suite/... --diagnostics

The same fix is applied to the clean command builder.

Agent-Logs-Url: https://github.com/microsoft/typescript-benchmarking/sessions/a7bef415-e1eb-4b1d-bb7e-57c06390d9d5

Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
@jakebailey jakebailey marked this pull request as ready for review April 19, 2026 12:42
@jakebailey jakebailey self-requested a review as a code owner April 19, 2026 12:42
@jakebailey jakebailey enabled auto-merge (squash) April 19, 2026 12:42
@jakebailey jakebailey merged commit c9fdb26 into main Apr 19, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants