Skip to content

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