zimfw / completion

Enables and configures smart and extensive tab completion.
MIT License
37 stars 10 forks source link

Check for compdump change with dat file #12

Closed ericbn closed 1 year ago

ericbn commented 1 year ago

containing more information, based on the data used by zsh4humans by @romkatv. The cost of checking that during startup was not significant when measured with the zsh-branch of zsh-framework-benchmark in the GitHub Action machine. The benefit is the end of worries about the compdump file being out-of-date.

ericbn commented 1 year ago

This is the result of the zsh-framework-benchmark in the GitHub Action machine: results

framework mean stddev min max
zim 0.0503534 0.00056605 0.049274 0.052293
zim-branch1 0.0510828 0.0005732 0.049966 0.053003
zim-branch2 0.0510304 0.00040146 0.050223 0.052125
zim-branch3 0.0512581 0.00052467 0.050355 0.052803

These are the meaning of the different branches:

I saw different results in my Mid 2015 MacBook Pro with SSD using Zsh 5.9, with zim-branch2 taking 38% more time than zim. Also ran this in a very old Windows laptop with HD using WSL1 and Zsh 5.4.2, and zim-branch2 took only 8% more time than zim.

@romkatv, I want to include a thank you note in the README.md and "Copyright (c) 2020 Roman Perepelitsa" in the MIT LICENSE if we merge this. Should I also include something else?

@Eriner, since the idea was always to keep Zim as light as possible, please let me know your thoughts on this.

Thoughts and benchmarks for anyone wanting to contribute to the discussion are also more than welcome.

EDIT: To run the benchmarks for all branches locally, make sure you have an up-to-date clone of https://github.com/zimfw/zsh-framework-benchmark and then do:

$ git checkout zim-branch
$ source run.zsh -n 10 -f zim -f zim-branch1 -f zim-branch2 -f zim-branch3
romkatv commented 1 year ago

@romkatv, I want to include a thank you note in the README.md and "Copyright (c) 2020 Roman Perepelitsa" in the MIT LICENSE if we merge this.

I appreciate it.

Eriner commented 1 year ago

I have no issue with this if it fixes the issue. The negative effects of start speed usually happen when there are a lot of small files and slow IO (old machines with HDDs, rpis, other single-board computers). One file addition isn't a concern to me and I'm glad the issue is resolved.

Thanks for the tests and comparisons @ericbn, and thanks for the underlying fix @romkatv!

Does upstream zsh have an opinion on this issue, btw? It seems odd that this song-and-dance is required just for it to work like you'd expect.