Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too slow finding files #22

Open
Menci opened this issue Jan 29, 2017 · 6 comments
Open

Too slow finding files #22

Menci opened this issue Jan 29, 2017 · 6 comments

Comments

@Menci
Copy link

Menci commented Jan 29, 2017

The command locate runs much faster then this plugin.

Maybe we can adapt the locate command, or maintain a local file index cache?

@bayleedev
Copy link
Member

Originally this had a file cache, but there were a lot of issues with maintaining it.

If we go back to a cache we'd need a few things

  • Limit to specific directories
  • Update frequently, new files should show up

Locate searches everything, so we could filter the results once we have them, but it only updates daily or weekly and doesn't appear to have a way to force update it. Likely because it's indexing the entire file system.

@twang2218
Copy link
Member

I will work on this issue, fileFinder seems cost several minutes to complete, which too long to use without caching. So, I think the cache database is necessary here.

How about using fs.watch for short term file updates, and scan the directories for every hour or every certain times to regenerate the whole database?

@bayleedev
Copy link
Member

bayleedev commented Feb 17, 2017

@twang2218 Right now @afaur is working on a rewrite to make an "adapter" pattern, which should be done this weekend. This should allow more patterns to emerge like the one you are talking about.

The issue with the fs.watch is the number of files. For example on smaller hard drives (like mine) the file finder is quick so there's no need for a cache. A larger hard drive (like @afaur 's haha) takes longer, but the "cache" would be huge as well. Caching the files was actually the first approach we took in making the file finder, but the file cache was over 1GB, so a huge watch! :o

The pattern that @afaur is trying to implement is mdfind (for osx), but once it's done we can also make a locate one and a few others for os specific things. [:

@bayleedev
Copy link
Member

Since the adapter is merged in now, if anybody wants to make a locate adapter, now is your chance :D

@natew
Copy link

natew commented Mar 13, 2018

Just curious, this is replacing mdfind with locate right? Is locate really that much faster than mdfind?

@bayleedev
Copy link
Member

I wouldn't replace mdfind with locate, but I'd accept it as another adapter people can pick from.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants