Skip to content

Commit

Permalink
feat(performance): add zsh-bench configs
Browse files Browse the repository at this point in the history
  • Loading branch information
olets committed Dec 6, 2023
1 parent 21c5028 commit 7720678
Show file tree
Hide file tree
Showing 10 changed files with 98 additions and 0 deletions.
11 changes: 11 additions & 0 deletions performance/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Performance

At last benchmark, Git Prompt Kit adds roughly 4ms of lag to the first prompt and to the first command when not customized, roughly 8ms lag to the first prompt and first command when fully customized, and under 1.5ms to the time it takes each prompt to appear.

Raw single-run data is available at <https://oletsdev.notion.site/4885a1a3749c45f3b6dbb1e2f924e47e?v=db09d78ce4474da5a6355964dda2bb7a>.

Run the performance suite (requires [zsh-bench](https://github.com/romkatv/zsh-bench)) with

```shell
zsh-bench --isolation docker --config-dir ./performance -- not-sourced sourced sourced-customized
```
7 changes: 7 additions & 0 deletions performance/not-sourced/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env zsh

emulate -L zsh -o err_return

cp -r -- ${ZSH_SCRIPT:h}/skel/*(D) ~/
cd
git clone -q --depth=1 --single-branch --branch v4 https://github.com/olets/git-prompt-kit.git
1 change: 1 addition & 0 deletions performance/not-sourced/skel/.zshev
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
setopt no_global_rcs
Empty file.
7 changes: 7 additions & 0 deletions performance/sourced-customized/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env zsh

emulate -L zsh -o err_return

cp -r -- ${ZSH_SCRIPT:h}/skel/*(D) ~/
cd
git clone -q --depth=1 --single-branch --branch v4 https://github.com/olets/git-prompt-kit.git
1 change: 1 addition & 0 deletions performance/sourced-customized/skel/.zshev
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
setopt no_global_rcs
62 changes: 62 additions & 0 deletions performance/sourced-customized/skel/.zshrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
GIT_PROMPT_KIT_COLOR_ACTION="black"
GIT_PROMPT_KIT_COLOR_ASSUME_UNCHANGED="black"
GIT_PROMPT_KIT_COLOR_CWD="black"
GIT_PROMPT_KIT_COLOR_FAILED="black"
GIT_PROMPT_KIT_COLOR_HEAD="black"
GIT_PROMPT_KIT_COLOR_HOST="black"
GIT_PROMPT_KIT_COLOR_INACTIVE="black"
GIT_PROMPT_KIT_COLOR_PUSH_REMOTE="black"
GIT_PROMPT_KIT_COLOR_REMOTE="black"
GIT_PROMPT_KIT_COLOR_SKIP_WORKTREE="black"
GIT_PROMPT_KIT_COLOR_STAGED="black"
GIT_PROMPT_KIT_COLOR_STASH="black"
GIT_PROMPT_KIT_COLOR_SUCCEEDED="black"
GIT_PROMPT_KIT_COLOR_TAG="black"
GIT_PROMPT_KIT_COLOR_UNSTAGED="black"
GIT_PROMPT_KIT_COLOR_USER="black"
GIT_PROMPT_KIT_HIDE_INACTIVE_AHEAD_BEHIND="0"
GIT_PROMPT_KIT_HIDE_INACTIVE_EXTENDED_STATUS="0"
GIT_PROMPT_KIT_HIDE_TOOL_NAMES="0"
GIT_PROMPT_KIT_SHOW_INACTIVE_STATUS="0"
GIT_PROMPT_KIT_SYMBOL_AHEAD="x"
GIT_PROMPT_KIT_SYMBOL_AHEAD_INACTIVE="x"
GIT_PROMPT_KIT_SYMBOL_ASSUME_UNCHANGED="x"
GIT_PROMPT_KIT_SYMBOL_ASSUME_UNCHANGED_INACTIVE="x"
GIT_PROMPT_KIT_SYMBOL_BEHIND="x"
GIT_PROMPT_KIT_SYMBOL_BEHIND_INACTIVE="x"
GIT_PROMPT_KIT_SYMBOL_BRANCH="x"
GIT_PROMPT_KIT_SYMBOL_CHAR_NORMAL="x"
GIT_PROMPT_KIT_SYMBOL_CHAR_ROOT="x"
GIT_PROMPT_KIT_SYMBOL_COMMIT="x"
GIT_PROMPT_KIT_SYMBOL_CONFLICTED="x"
GIT_PROMPT_KIT_SYMBOL_CONFLICTED_INACTIVE="x"
GIT_PROMPT_KIT_SYMBOL_DELETED="x"
GIT_PROMPT_KIT_SYMBOL_DELETED_INACTIVE="x"
GIT_PROMPT_KIT_SYMBOL_DELETED_STAGED="x"
GIT_PROMPT_KIT_SYMBOL_DELETED_STAGED_INACTIVE="x"
GIT_PROMPT_KIT_SYMBOL_HOST="x"
GIT_PROMPT_KIT_SYMBOL_LOCAL="x"
GIT_PROMPT_KIT_SYMBOL_MODIFIED="x"
GIT_PROMPT_KIT_SYMBOL_MODIFIED_INACTIVE="x"
GIT_PROMPT_KIT_SYMBOL_MODIFIED_STAGED="x"
GIT_PROMPT_KIT_SYMBOL_MODIFIED_STAGED_INACTIVE="x"
GIT_PROMPT_KIT_SYMBOL_NEW="x"
GIT_PROMPT_KIT_SYMBOL_NEW_INACTIVE="x"
GIT_PROMPT_KIT_SYMBOL_PUSH_REMOTE="x"
GIT_PROMPT_KIT_SYMBOL_REMOTE="x"
GIT_PROMPT_KIT_SYMBOL_SKIP_WORKTREE="x"
GIT_PROMPT_KIT_SYMBOL_SKIP_WORKTREE_INACTIVE="x"
GIT_PROMPT_KIT_SYMBOL_STASH="x"
GIT_PROMPT_KIT_SYMBOL_STASH_INACTIVE="x"
GIT_PROMPT_KIT_SYMBOL_TAG="x"
GIT_PROMPT_KIT_SYMBOL_UNTRACKED="x"
GIT_PROMPT_KIT_SYMBOL_UNTRACKED_INACTIVE="x"
GIT_PROMPT_KIT_CWD_MAX_TRAILING_COUNT="2"
GIT_PROMPT_KIT_DEFAULT_PUSH_REMOTE_NAME="push"
GIT_PROMPT_KIT_DEFAULT_REMOTE_NAME="remote"
GIT_PROMPT_KIT_HIDDEN_HOSTS="( my-host )"
GIT_PROMPT_KIT_HIDDEN_USERS="( my-user )"
GIT_PROMPT_KIT_REPO_SUBDIRECTORY_MAX_TRAILING_COUNT="2"
GIT_PROMPT_KIT_VERBOSE_DEFAULT_SYMBOLS="1"

source ~/git-prompt-kit/git-prompt-kit.zsh
7 changes: 7 additions & 0 deletions performance/sourced/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env zsh

emulate -L zsh -o err_return

cp -r -- ${ZSH_SCRIPT:h}/skel/*(D) ~/
cd
git clone -q --depth=1 --single-branch --branch v4 https://github.com/olets/git-prompt-kit.git
1 change: 1 addition & 0 deletions performance/sourced/skel/.zshev
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
setopt no_global_rcs
1 change: 1 addition & 0 deletions performance/sourced/skel/.zshrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
source ~/git-prompt-kit/git-prompt-kit.zsh

0 comments on commit 7720678

Please sign in to comment.