zazu-file-finder icon indicating copy to clipboard operation
zazu-file-finder copied to clipboard

Too slow finding files

Open Menci opened this issue 8 years ago • 6 comments

The command locate runs much faster then this plugin.

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

Menci avatar Jan 29 '17 06:01 Menci

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.

bayleedev avatar Jan 29 '17 18:01 bayleedev

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?

twang2218 avatar Feb 17 '17 18:02 twang2218

@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 avatar Feb 17 '17 18:02 bayleedev

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

bayleedev avatar Feb 24 '17 16:02 bayleedev

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

natew avatar Mar 13 '18 23:03 natew

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

bayleedev avatar Mar 21 '18 17:03 bayleedev