You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using large files. eg a json file with a 100 000 lines our scopes that looks at the entire file are quite slow. That two main cases for this is:
Tree sitter scope handler
Surrounding pair scope handler
The surrounding pair scope handler could be improved by parsing the file in chunks. Initially I been focused on debugging the Tree sitter scope handler and its matches function.
It's clear that the Tree sitter query match takes some time. This could be improved by not actually checking all patterns/captures and instead focusing on the one that's actually match to the requested scope type. It's also clear that our post processing in typescript is quite slow. I'm referring to the two map stages.
The text was updated successfully, but these errors were encountered:
AndreasArvidsson
changed the title
Improved performance when using large files
Improve performance when using large files
Aug 29, 2024
When using large files. eg a json file with a 100 000 lines our scopes that looks at the entire file are quite slow. That two main cases for this is:
The surrounding pair scope handler could be improved by parsing the file in chunks. Initially I been focused on debugging the Tree sitter scope handler and its matches function.
cursorless/packages/cursorless-engine/src/languages/TreeSitterQuery/TreeSitterQuery.ts
Lines 69 to 131 in 49f7084
I added a time log between each step in the return statement. The below is the result for
"take key"
in a 26MB json file.It's clear that the Tree sitter query match takes some time. This could be improved by not actually checking all patterns/captures and instead focusing on the one that's actually match to the requested scope type. It's also clear that our post processing in typescript is quite slow. I'm referring to the two map stages.
The text was updated successfully, but these errors were encountered: