bayleeadamoss / zazu-file-finder

A file finder for Zazu.
18 stars 11 forks source link

Add Option to Search Only On 'Find' Keyword #19

Closed Koolstr closed 7 years ago

Koolstr commented 7 years ago

I've noticed that this plugin slows down Zazu immensely, but that may be simply due to my library indexing size (in which case, I'd recommend optimizing your indexing and retrieval to be as immediate as the incredibly fast 'Everything' search tool: https://www.voidtools.com/).

I know that when I have this plugin uninstalled, Zazu is as speedy as it should be. So this plugin is also responsible for the laggy search box text updates (before the results are displayed).

I would like for you to include an option that would cause Zazu to only 'activate' your plugin and display results, when the search on Zazu is begun with the keyword 'Find'. This should resolve the substantial latency issue, by making it so that I only have to deal with the sluggishness when I am using Zazu to search for files. ;)

Obviously, the more ideal but much more difficult solution would be to optimize its search and indexing algorithms. Until this is done, I'm going to keep this plugin uninstalled.

bayleedev commented 7 years ago

That should already be the case.

We have 3 inputs. The first is the app finder, which searches a local cache only. The second and third are part of the file manager and require a prefix (find/open) to start using them.

Also, we should be doing all the actual searching in a forked process, so it shouldn't directly effect you unless it was slowing down the entire system, not just zazu.

Do you mind posting the specs to your box? Also, the directory sizes of the directories it's searching for/indexing. Maybe I can try and get a better idea of what the problem is then.

Koolstr commented 7 years ago

Sure, but how comprehensive specs are you looking for? Models or raw power levels? And how/where can I see which directories this plugin is indexing? Normally I would be able to white/blacklist directories but I can't figure it out in yours.

bayleedev commented 7 years ago

Just some basic specs processor/memory kinda of things.

The default directories are listed in here, under your os:

https://github.com/tinytacoteam/zazu-file-finder/blob/master/directories.js

Directories can be overwritten falling the file finder docs:

https://github.com/tinytacoteam/zazu-file-finder#installing

cecoates commented 7 years ago

Just out of curiosity, how large is your applications.json? I found that when mine was 500k+ (with lots and lots of items indexed) Zazu would slow down a lot with the first few characters you typed.

I ended up going with this:

   {
    "name": "tinytacoteam/zazu-file-finder",
    "variables": {
    "append": false,
    "directories": {
        "filePath": [
        "~/Documents",
                "~/Music"
            ],
        "appPath": [
        "/usr/bin",
                "~/bin"
            ]
            }
        }
    }

To exclude opt (Wine/Crossover has a LOT of files that begin with "c", and I use Chrome a lot), and I removed the executable permission from the random game files like maps in my ~/bin. Now it's pretty zippy, and it only seems to lag on characters that match a directory with a lot of executables in it, like usr. So the 2,100 executables in /usr causes about a 5-7 second delay with searches that begin with "u" or "us".

My /usr/bin is about 2,100 items, /opt is about 4,900 items, and my ~/bin is about 8,000 items.

My Documents folder is 26,000 items and Music is 8,700 items, but since "find" doesn't seem to match many apps, those searches happen pretty quick. Maybe 2 seconds. I haven't really noticed speed differences with find/open regardless of how many files/directories I add.

screenshot from 2017-01-20 20-01-54

My SSD is a 1TB Samsung 850 Evo.

https://github.com/tinytacoteam/zazu/issues/125#issuecomment-273370257

Koolstr commented 7 years ago

I'm running Windows 10, so your advice is less helpful than it could be. My applications.json was also over 500KB, and I excluded the filePath to only index one folder from my computer. Nonetheless, search is still slow and laggy. Perhaps you are right that the app.json is slowing it down. But what can I do to get it to exclude all files except fro .exe's in the listed directories?

My specs are as follows: Intel i7 4720HQ CPU 2.6GHz, 8GB RAM, 250GB SSD, HP OMEN, Windows 10 64-bit.

bayleedev commented 7 years ago

If you don't want it to index your applications you can organize your directories like this:

{
  "plugins": [
    {
      "name": "tinytacoteam/zazu-file-finder",
      "variables": {
        "append": false,
        "directories": {
          "appPath": [],
        }
      }
    }
  ]
}

The important parts is that we are setting append to false so it overwrites the appPath which we set to an empty array. So now it'll only find things on find and open without indexing your computer for applications.