danhper / fundle

A minimalist package manager for fish shell
MIT License
375 stars 22 forks source link

Improve performance #42

Closed faho closed 5 years ago

faho commented 5 years ago

This successively improves fundle init time for 19 plugins from ~330ms to ~75ms, mainly by replacing use of external tools with string (which requires fish >= 2.3.0 from 2016).

Most of these commits are fairly self-explanatory.

I've only lightly tested this as I don't use fundle myself. The commits that I'd assume require the most testing are 9479053 and b488003.

Also, removing eval is a good in itself and in this case might even fix a few latent bugs.

Fixes #38.

Closes #25 (absolutely no compatibility with <2.3 anymore, but it's been a few years since that issue was opened).

faho commented 5 years ago

I can't say I quite understand the clean test, which is still failing. One possible reason is that the ordering is different - globs are sorted.

danhper commented 5 years ago

Great, thank you very much. I'll try it locally for a while and publish a new version in a few days.

danhper commented 5 years ago

For the clean function, plugin was equal to /foo/with_init/ instead of foo/with_init so all plugins were considered as unused and would have been removed when running clean. The leading / was due to a change from sed to string match (eff51dd223c6c98a13b454be54b0e4d2b0dc258e) which did not respect the original behavior and the trailing / was due to a change from find to glob (c8e555536146eb35ecd4c88c8034516b2f67aec2)

BarbzYHOOL commented 5 years ago

fundle self-update fundle is already up to date

:'(

danhper commented 5 years ago

Yes, I wanted to use it a little locally before actually pushing the new version. Everything things to be just fine (and faster!) so I just pushed the new version. Thanks again @faho

BarbzYHOOL commented 5 years ago

thank you @faho and @danhper

BarbzYHOOL commented 5 years ago

yeah, just did the test with fundle init --profile (I noted that the output is different from before) and with 7 more plugins, I have a load time of 0.01 seconds instead of 1 second