New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve overall plugins load performance #141

Closed
wants to merge 3 commits into
base: master
from

Conversation

Projects
None yet
3 participants
@outcoldman
Copy link
Contributor

outcoldman commented Jul 16, 2015

-antigen-parse-args is very expensive. Avoiding using it in internal calls improve overall performance.
Instead of using -antigen-parse-args just invoke functions with arguments in expected order.

I got 50% performance improvement.

Improve overall plugins load performance
-antigen-parse-args is very expensive. Avoiding using it in internal calls improve overall performance.
Instead of using -antigen-parse-args just invoke functions with arguments in expected order.
@outcoldman

This comment has been minimized.

Copy link
Contributor Author

outcoldman commented Jul 16, 2015

Just a note, another way to get 50% improvement is to avoid using -antigen-parse-args at all. For example in my own .zshrc I specified function right after source ./antigen/antigen.zsh

    antigen-fbundle() {
        local loc=$1
        local url=${2:-$ANTIGEN_DEFAULT_REPO_URL}
        local make_local_clone=${3:-true}
        local btype=${4:-plugin}
        if $make_local_clone; then
            -antigen-ensure-repo $url
        fi

        _ANTIGEN_BUNDLE_RECORD="$_ANTIGEN_BUNDLE_RECORD\n$url $loc $btype"
        _ANTIGEN_BUNDLE_RECORD="$_ANTIGEN_BUNDLE_RECORD $make_local_clone"

        -antigen-load "$url" "$loc" "$make_local_clone"
    }

After that I use simplified syntax of


    antigen use oh-my-zsh

    antigen-fbundle plugins/bower
    #... other plugins

    # load from url
    antigen-fbundle / https://github.com/Tarrasch/zsh-autoenv.git

    # load from local locations (my own plugins)
    antigen-fbundle / ./plugins/aliases false

    # Load plugin
    antigen-fbundle powerlevel9k.zsh-theme https://github.com/bhilburn/powerlevel9k.git

    antigen apply
@desyncr

This comment has been minimized.

Copy link
Member

desyncr commented Jul 16, 2015

I think they'll like to keep the old syntax. Regardless of that it's an alternative to the whole cache thing at #129. I'll try this later today.

@outcoldman

This comment has been minimized.

Copy link
Contributor Author

outcoldman commented Jul 16, 2015

@desyncr sure, it make sense, I don't want to change the syntax, this is why I just mentioned that it can be another way to improve performance.

This pull request is only about avoiding unnecessary using -antigen-parse-args in internal calls.

We definitely need to fix -antigen-parse-args, as it makes antigen load in 4x times slower. As a proposal we can make it less generic and work only for antigen bundle (including all other alternatives, like use or theme).

@forivall

This comment has been minimized.

Copy link

forivall commented Jul 16, 2015

Just remember, desyncr isn't a contributor to antigen at all. I have a fixed version of antigen-parse-args in #132, but abandoned it because the maintainers seem to be absent, so I just switched to zgen.

@outcoldman

This comment has been minimized.

Copy link
Contributor Author

outcoldman commented Jul 16, 2015

@forivall looking on the history of commits it seems like that original maintainer @sharat87 is looking on patches once in a month, so we just need to have a little bit of patience. Could you reopen your pull request as it can be very useful for all antigen users.

team-sonique pushed a commit to team-sonique/antigen that referenced this pull request Jul 28, 2015

@desyncr desyncr referenced this pull request Nov 11, 2015

Open

Remove -zpm-parse-args #16

@desyncr desyncr self-assigned this Jul 16, 2016

@desyncr desyncr added the Feature label Jul 16, 2016

@desyncr

This comment has been minimized.

Copy link
Member

desyncr commented Jul 21, 2016

Thank you @outcoldman for these changes. It has been merged.

@desyncr desyncr closed this Jul 21, 2016

@desyncr desyncr referenced this pull request Sep 26, 2016

Closed

Remove parse-args function #257

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment