Skip to content

Commit 704cfaa

Browse files
committed
perf(linter/plugins): provide loc via prototype (#14552)
#14355 added a getter for `loc` to all AST nodes in Oxlint's JS-side AST. Unfortunately it turned out to have been a massive perf hit. Reduce the cost by adding `loc` field to nodes via prototype, rather than adding a getter to each object individually. This does not entirely remove the cost of `loc`, but reduces it from about 300% perf hit to around ~20% (measured by Oxlint's performance linting VS Code repo with a simple JS plugin).
1 parent ca4441c commit 704cfaa

File tree

2 files changed

+244
-679
lines changed

2 files changed

+244
-679
lines changed

0 commit comments

Comments
 (0)