Bottom to top
![image](https://user-images.githubusercontent.com/16418197/110018533-ffc29380-7cec-11eb-92ab-b8f8558a5592.png)
![image](https://user-images.githubusercontent.com/16418197/110018830-5a5bef80-7ced-11eb-8fa2-3b1b895f4061.png)
![image](https://user-images.githubusercontent.com/16418197/110018927-78295480-7ced-11eb-876c-0327163e91b6.png)
![image](https://user-images.githubusercontent.com/16418197/110019058-9ee78b00-7ced-11eb-8f84-ea7239fcc17e.png)
WIP
Zadeh supports adding all the files to its cache using
ArrayFilterer
instead of callingfilter
every time. If we useArrayFilterer
searching will be faster https://github.com/atom-community/zadeh#arrayfiltererI'm also inclined to add the things like
prefix
(which is used asrelativeToPath
here) orextention
filtering to Zadeh.Benchmarks to test:
Repo DefinitelyTyped
Calling
filter
directly each time takes 25ms (typeimport "something"
) https://github.com/atom-community/autocomplete-paths/blob/1d6979f65db931430e2f077f119e5c8505db5f79/lib/paths-provider.js#L138Filtering extensions takes 7.5ms (type
import "something"
) https://github.com/atom-community/autocomplete-paths/blob/1d6979f65db931430e2f077f119e5c8505db5f79/lib/paths-provider.js#L132-L135Filtering relativeToPath takes 7.7ms (type
import "./"
) https://github.com/atom-community/autocomplete-paths/blob/1d6979f65db931430e2f077f119e5c8505db5f79/lib/paths-cache.js#L64Other benchmarks:
Top to bottom
Bottom to top
![image](https://user-images.githubusercontent.com/16418197/110018533-ffc29380-7cec-11eb-92ab-b8f8558a5592.png) ![image](https://user-images.githubusercontent.com/16418197/110018830-5a5bef80-7ced-11eb-8fa2-3b1b895f4061.png) ![image](https://user-images.githubusercontent.com/16418197/110018927-78295480-7ced-11eb-876c-0327163e91b6.png) ![image](https://user-images.githubusercontent.com/16418197/110019058-9ee78b00-7ced-11eb-8f84-ea7239fcc17e.png)