Skip to content

Remove cancellationToken.js - #60250

Merged
Jake Bailey (jakebailey) merged 3 commits into
microsoft:mainfrom
jakebailey:remove-cancellation-token
Nov 5, 2024
Merged

Remove cancellationToken.js#60250
Jake Bailey (jakebailey) merged 3 commits into
microsoft:mainfrom
jakebailey:remove-cancellation-token

Conversation

@jakebailey

Copy link
Copy Markdown
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
Copy Markdown
Member

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
Copy Markdown
MemberAuthor

TypeScript Bot (@typescript-bot) perf test startup-only

@typescript-bot

TypeScript Bot (typescript-bot) commented Oct 31, 2024

Copy link
Copy Markdown
Contributor

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

CommandStatusResults
perf test startup-only✅ Started👀 Results

@typescript-bot

Copy link
Copy Markdown
Contributor

Jake Bailey (@jakebailey)
The results of the perf run you requested are in!

Here they are:

startup

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
tsc-startup - node (v18.15.0, x64)
Execution time185.48ms (± 0.21%)185.53ms (± 0.19%)~183.91ms190.13msp=0.076 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time289.13ms (± 0.28%)287.92ms (± 0.29%)-1.21ms (- 0.42%)280.84ms293.74msp=0.000 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time274.75ms (± 0.30%)274.77ms (± 0.28%)~267.99ms278.49msp=0.702 n=600
typescript-startup - node (v18.15.0, x64)
Execution time272.39ms (± 0.31%)272.32ms (± 0.29%)~265.28ms279.62msp=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)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

Developer Information:

Download Benchmarks

@jakebailey
Jake Bailey (jakebailey) merged commit 9d7e087 into microsoft:mainNov 5, 2024
@jakebailey
Jake Bailey (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;
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

constmode=ts.server.findArgument("--serverMode");

Copy link
Copy Markdown
MemberAuthor

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
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That was quick! Thanks.

@microsoftMicrosoft (microsoft) locked as resolved and limited conversation to collaborators Oct 16, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: TeamFor Uncommitted BugPR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@jakebailey@typescript-bot@sandersn@mrazauskas