8000 Add more cancellation points to resolveConstants by elliottt · Pull Request #8809 · sorbet/sorbet · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add more cancellation points to resolveConstants #8809

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

Merged
merged 1 commit into from
May 1, 2025

Conversation

elliottt
Copy link
Collaborator

The resolveConstants step of the resolver is currently one of the long poles between cancellation points, and this PR addresses that by adding cancellation to the most expensive part: the initial traversal of the input trees.

Motivation

Improving cancellation latency in LSP.

Test plan

Existing tests.

@elliottt elliottt requested a review from a team as a code owner April 30, 2025 15:46
@elliottt elliottt requested review from neilparikh and removed request for a team April 30, 2025 15:46
@elliottt elliottt marked this pull request as draft April 30, 2025 15:46
computedTreesCount++;

if (!cancelled) {
if (computedTreesCount % 250 == 0 && gs.epochManager->wasTypecheckingCanceled()) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This number is arbitrary, and taken from namer.cc.

@elliottt elliottt marked this pull request as ready for review April 30, 2025 20:05
@elliottt elliottt requested a review from jez April 30, 2025 20:05
@elliottt elliottt merged commit 8bc0e29 into master May 1, 2025
15 checks passed
@elliottt elliottt deleted the trevor/more-cancellation-points branch May 1, 2025 00:11
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
0