asimov icon indicating copy to clipboard operation
asimov copied to clipboard

Speed up searching for exclusions

Open jmarceli opened this issue 6 years ago • 6 comments

Thanks for that tool, exactly something I was looking for.

One thing that may make it even better would be skipping some common folders while searching for development dependencies like:

  • ~/Library
  • ~/Applications
  • ~/Music etc.

jmarceli avatar May 10 '18 07:05 jmarceli

https://github.com/stevegrunwell/asimov/pull/18 excludes ~/Library as part of other speedup work - we can add others in the same way I suppose, but I wonder if there's a point where the exclusion checks make the overall process slower than just quickly scanning directories!

rowanbeentje avatar May 10 '18 08:05 rowanbeentje

I was thinking rather about exclusion directly through find, something like (according to https://stackoverflow.com/questions/4210042/how-to-exclude-a-directory-in-find-command):

find ~ -type d -name "${parts[0]}" -not -path "/Users/*/Library/*"

I think that this shouldn't hit overall performance (I'm not a find expert so I may be wrong).

Also ~/.Trash exclusion would be nice, because even if I have trash excluded in TimeMachine I still have to wait for Asimov to scan through.

Regarding the speed. Maybe excluding nested node_modules with find rather than inside the dependency_file_exists() would save some time? What I mean is:

 find ~ -type d -name "${parts[0]}" -not -path "*/node_modules/*/node_modules*"

jmarceli avatar May 10 '18 09:05 jmarceli

https://github.com/stevegrunwell/asimov/pull/17 (included in https://github.com/stevegrunwell/asimov/pull/18 as well!) excludes subdeps, and yeah, that -not -path is the approach used to exclude ~/Library - I just can't help feeling that will have a cost.

(Trashes folders are a great one though)

rowanbeentje avatar May 10 '18 09:05 rowanbeentje

I'm still waiting for ~/.Trash to complete processing (about 20min) despite the fact that I've excluded trash in TM anyway...

The first run of Asimov takes about 2:30 hours, but the overall effect is great. Thanks for this script.

jmarceli avatar May 10 '18 09:05 jmarceli

Also ~/.Trash exclusion would be nice, because even if I have trash excluded in TimeMachine I still have to wait for Asimov to scan through.

Wouldn't it be better to just automatically skip all folders that are excluded from time machine then?

FlorianWendelborn avatar May 10 '18 18:05 FlorianWendelborn

Yep, why not exclude everything inside the TimeMaschine ignore list from the find process? I mean the ignore list that you can manually edit in the TimeMaschin pane in settings.

muuvmuuv avatar Jul 02 '18 17:07 muuvmuuv