helixbass / tree-sitter-grep

The Unlicense
10 stars 1 forks source link

Parallelize enumerate project files -> query matching #10

Closed helixbass closed 1 year ago

helixbass commented 1 year ago

In this PR:

I did this because it was seeming like there was a noticeable initial "pause" before any results started showing up and I assumed that was the "enumerating project files" phase, which made me think that it would probably be a significant improvement to overall runtime to not block on that. Indeed here is a basic timing graph from before this branch:

Screen Shot 2023-05-30 at 12 21 48 PM

And after:

Screen Shot 2023-05-30 at 12 22 13 PM

In terms of roughly-measured (via time) overall runtime, against the Typescript compiler in Rust codebase it looks like it went from ~460-480ms to ~280-300ms so maybe a 35-40% speedup?

Based on filter-plugin-c-ffi

helixbass commented 1 year ago

Closing in favor of #11