Skip to content

Commit

Permalink
Merge pull request #1 from zdharma-continuum/docs/format-markdown
Browse files Browse the repository at this point in the history
docs: format README.md, fix broken links, and improve readability
  • Loading branch information
vladdoster authored Jul 16, 2022
2 parents 007ef73 + 0a118f0 commit 51b3640
Showing 1 changed file with 62 additions and 55 deletions.
117 changes: 62 additions & 55 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
# Performance test of some of Zsh plugin managers
# Performance test of some of the Zsh plugin managers

To run the test, execute:

```zsh
% ./run.zsh
./run.zsh
```

However, there are problems with `zplug` when the test is run in this way – the
However, there are problems with `zplug` when running the test this way – the
test hangs with a message:

```
zsh: suspended (tty input) ./run.zsh
```

so an invocation of `fg` is required. To address this, run the test script as a
function:
So an invocation of `fg` is required. To address this, run the test script as a function:

```zsh
fpath+=( $PWD )
Expand All @@ -24,59 +23,70 @@ run.zsh

## Drawing the results

To compute average results and draw the plots, run `plot.py` Python script. It
needs `matplotlib` Python package.
To generate a graph of the average load times:

First, install dependencies:

```zsh
python3 -m pip install matplotlib
```

Then,

```zsh
python3 plot.py
```

## Details of the test

Following 28 plugins are being used in the test:
The test loads the following 28 plugins:

```
zdharma/zsh-unique-id
Oh My Zsh / lib/git.zsh
Oh My Zsh / plugins/git/git.plugin.zsh
trapd00r/LS_COLORS
zdharma/zconvey
arzzen/git-quick-stats.git
fakerr/git-recall
geometry-zsh/geometry
hlissner/zsh-autopair
iwata/git-now
jhawthorn/fzy
junegunn/fzf-bin
k4rthik/git-cal
ogham/exa
ohmyzsh / lib/git.zsh
ohmyzsh / plugins/git/git.plugin.zsh
tj/git-extras
trapd00r/ls_colors
urbainvaes/fzf-marks
hlissner/zsh-autopair
psprint/zsh-editing-workbench
psprint/zsh-navigation-tools
zdharma/history-search-multi-word
geometry-zsh/geometry
zdharma/zui
voronkovich/gitignore.plugin.zsh
zdharma-continuum/declare-zshrc
zdharma-continuum/git-url
zdharma-continuum/history-search-multi-word
zdharma-continuum/revolver
zdharma-continuum/vramsteg-zsh
zdharma-continuum/zconvey
zdharma-continuum/zsh-diff-so-fancy
zdharma-continuum/zsh-editing-workbench
zdharma-continuum/zsh-navigation-tools
zdharma-continuum/zsh-unique-id
zdharma-continuum/zui
zdharma-continuum/zunit
zsh-users/zsh-autosuggestions
ogham/exa
psprint/vramsteg-zsh
psprint/revolver
psprint/zunit
zdharma/declare-zshrc
zdharma/zsh-diff-so-fancy
iwata/git-now
tj/git-extras
k4rthik/git-cal
zdharma/git-url
Fakerr/git-recall
arzzen/git-quick-stats.git
```

Some of the plugins are rather regular `Makefile`-based projects, like
Some of the plugins are relatively regular `Makefile`-based projects, like
`arzzen/git-quick-stats.git`. The `atclone''`, `make''`, ice modifiers of
Zinit and `hook-build` tag of Zplug allow to install and use them. However
Zinit and the `hook-build` tag of Zplug allow to install and use them. However
they're problematic with `zgen`, which doesn't have such hooks. For it, instead
an empty plugin [zdharma/null](https://github.com/zdharma/null) is being loaded
in a following way:

```zsh

# git-recall
zgen load zdharma/null null.plugin.zsh empty-plugin.zsh-13
zgen load zdharma-continuum/null null.plugin.zsh empty-plugin.zsh-13
```

```zsh
# git-quick-stats
zgen load zdharma/null null.plugin.zsh empty-plugin.zsh-14
zgen load zdharma-continuum/null null.plugin.zsh empty-plugin.zsh-14
```

the `empty-plugin.zsh-14`, etc. is a branch. The file `null.plugin.zsh` contains
Expand All @@ -88,44 +98,41 @@ only 3 instructions:
true
```

this way a little balance is introduced into the test. IMO it's a good lower
boundary for the comparison – to have `zgen` only clone and load an almost empty
This way, a little balance is introduced into the test and creates a good
minimum for the comparison – to have `zgen` only clone and load an almost empty
plugin instead of setting up a `PATH` for a command-like plugin, especially
because of the way that `zgen` works – by storing a plain `source` commands and
because of the way that `zgen` works – by storing plain `source` commands and
not executing any code.

This however puts `zgen` on an overall better position, also because it has to
clone an almost empty repository and not a full project, so also the
However, it puts `zgen` in a better position because it has to
clone an almost empty repository and not a complete project, so the
installation-time test is biased. However, it's hard to address this without
simplifying the test because of limited `zgen` functionality. Also, `zgen`
doesn't run the compilation (i.e. `make`) during the installation of the
plugins.

Zplug and Zinit tests are rather identical
Zplug and Zinit tests are relatively identical
([zshrc](https://github.com/zdharma/pm-perf-test/blob/master/zplug/.zshrc) for
Zplug,
[zshrc](https://github.com/zdharma/pm-perf-test/blob/master/zinit-load/.zshrc)
for Zinit).

## Results

![Installation times](https://raw.githubusercontent.com/zdharma/pm-perf-test/master/plots/installation-times.png)
![Installation times](https://raw.githubusercontent.com/zdharma-continuum/pm-perf-test/master/plots/installation-times.png)

![Startup times](https://raw.githubusercontent.com/zdharma/pm-perf-test/master/plots/startup-times.png)
![Startup times](https://raw.githubusercontent.com/zdharma-continuum/pm-perf-test/master/plots/startup-times.png)

## Result comments

The three different Zinit results needs explaining:

1. Zinit light – plugins are being loaded without tracking, i.e.: cannot be
unloaded and their reports are being empty.

2. Zinit load – plugins are being loaded with tracking, i.e.: are available for
unload and their report data is gathered (available through `zinit report
{plugin-name}` command).
The three different Zinit results need explaining:

3. Zinit (Turbo) load – plugins are being loaded with tracking **and in Turbo
mode** – i.e.: in background & after prompt – the shell is instantly ready to
1. Zinit light – plugins are being loaded without tracking, i.e., cannot be
unloaded, and their reports are empty.
1. Zinit load – plugins are being loaded with tracking, i.e., are available for
unloading, and their report data is gathered (available through `zinit report {plugin-name}` command).
1. Zinit (Turbo) load – plugins are loaded with tracking **and in Turbo
mode** – i.e., in the background & after prompt – the shell is instantly ready to
use.

<!-- vim:set ft=markdown tw=80 autoindent: -->

0 comments on commit 51b3640

Please sign in to comment.