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

Do not search for nested arrow functions outside of arrow functions #341

Closed
wants to merge 1 commit into from

Conversation

sirbrillig
Copy link
Owner

@sirbrillig sirbrillig commented Dec 2, 2024

#334 caused a performance regression. This line was now performing a large scope search for every token when searching for a variable's scope in order to find the scope of nested arrow functions, even if the current variable was not inside an arrow function.

In this diff we prevent searching for the arrow function's scope opener if we are not inside an arrow function. That does not speed up searching for the arrow function scope itself but it will prevent this cost being paid for every variable.

Fixes #340

@sirbrillig
Copy link
Owner Author

Hm... This is not accurate. We can't know if we're in an arrow function without knowing the closing scope. Let me try something else.

@sirbrillig sirbrillig closed this Dec 2, 2024
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.

Unexpected slowness since v2.11.20
1 participant