Skip to content

perf: various optimization with ast walk#2969

Merged
jasonlyu123 merged 1 commit intomasterfrom
ast-perf
Mar 14, 2026
Merged

perf: various optimization with ast walk#2969
jasonlyu123 merged 1 commit intomasterfrom
ast-perf

Conversation

@jasonlyu123
Copy link
Member

Found this while benchmarking a large file for #2963. Turns out the getChildren() method parses part of the file again to include syntax nodes such as keywords or parentheses. Some of our use cases don't need these nodes.
Another one is switching the order of svelteNodeAt and charCode. charCode is generally very fast, so checking it first can be faster.

@changeset-bot
Copy link

changeset-bot bot commented Mar 5, 2026

🦋 Changeset detected

Latest commit: 7bb4bd2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
typescript-svelte-plugin Patch
svelte-language-server Patch
svelte-check Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jasonlyu123 jasonlyu123 merged commit c11658e into master Mar 14, 2026
3 checks passed
@jasonlyu123 jasonlyu123 deleted the ast-perf branch March 14, 2026 08:49
@github-actions github-actions bot mentioned this pull request Mar 14, 2026
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.

1 participant