Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove cancellationToken.js #60250

Merged
merged 3 commits into from
Nov 5, 2024

Conversation

jakebailey
Copy link
Member

cancellationToken.js is a file which contains an implementation of a file-based cancellation token. It is loaded dynamically by tsserver.js, but nowhere else. As far as I can tell, there's no reason to not just include its code in tsserver.js directly and drop the extra file and require.

(Going through the repo history also doesn't indicate why this was a separate file; perhaps there's a good reason for this to exist and I lack context.)

Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason to have it separate that I know of.

@jakebailey
Copy link
Member Author

@typescript-bot perf test startup-only

@typescript-bot
Copy link
Collaborator

typescript-bot commented Oct 31, 2024

Starting jobs; this comment will be updated as builds start and complete.

Command Status Results
perf test startup-only ✅ Started 👀 Results

@typescript-bot
Copy link
Collaborator

@jakebailey
The results of the perf run you requested are in!

Here they are:

startup

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
tsc-startup - node (v18.15.0, x64)
Execution time 185.48ms (± 0.21%) 185.53ms (± 0.19%) ~ 183.91ms 190.13ms p=0.076 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time 289.13ms (± 0.28%) 287.92ms (± 0.29%) -1.21ms (- 0.42%) 280.84ms 293.74ms p=0.000 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time 274.75ms (± 0.30%) 274.77ms (± 0.28%) ~ 267.99ms 278.49ms p=0.702 n=600
typescript-startup - node (v18.15.0, x64)
Execution time 272.39ms (± 0.31%) 272.32ms (± 0.29%) ~ 265.28ms 279.62ms p=0.535 n=600
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • tsc-startup - node (v18.15.0, x64)
  • tsserver-startup - node (v18.15.0, x64)
  • tsserverlibrary-startup - node (v18.15.0, x64)
  • typescript-startup - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@jakebailey jakebailey merged commit 9d7e087 into microsoft:main Nov 5, 2024
32 checks passed
@jakebailey jakebailey deleted the remove-cancellation-token branch November 5, 2024 22:35
Comment on lines +677 to +683
let cancellationPipeName: string | undefined;
for (let i = 0; i < args.length - 1; i++) {
if (args[i] === "--cancellationPipeName") {
cancellationPipeName = args[i + 1];
break;
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jakebailey Perhaps ts.server.findArgument() can be used here as well?

const mode = ts.server.findArgument("--serverMode");

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR was a pure code move; that could be a refactor later, sure

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was quick! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants