autocomplete-paths icon indicating copy to clipboard operation
autocomplete-paths copied to clipboard

Faster autocomplete list showing

Open aminya opened this issue 4 years ago • 0 comments

WIP

Zadeh supports adding all the files to its cache using ArrayFilterer instead of calling filter every time. If we use ArrayFilterer searching will be faster https://github.com/atom-community/zadeh#arrayfilterer

I'm also inclined to add the things like prefix (which is used as relativeToPath here) or extention filtering to Zadeh.

Benchmarks to test:

Repo DefinitelyTyped

  • Calling filter directly each time takes 25ms (type import "something") https://github.com/atom-community/autocomplete-paths/blob/1d6979f65db931430e2f077f119e5c8505db5f79/lib/paths-provider.js#L138

  • Filtering extensions takes 7.5ms (type import "something") https://github.com/atom-community/autocomplete-paths/blob/1d6979f65db931430e2f077f119e5c8505db5f79/lib/paths-provider.js#L132-L135

  • Filtering relativeToPath takes 7.7ms (type import "./") https://github.com/atom-community/autocomplete-paths/blob/1d6979f65db931430e2f077f119e5c8505db5f79/lib/paths-cache.js#L64

Other benchmarks:

Top to bottom image

Bottom to top

image

image

image

image

aminya avatar Mar 04 '21 17:03 aminya