dein.vim and vim-plug are two fairly popular vim package managers. I haven’t see any benchmark result so far, and I am too inpatient to wait so…

Disclaim: The following script is based on https://gist.github.com/b4b4r07/3eccb4f8dd9438c706fe7950ef2f669f (I adapted it a bit for easy reproducibility, and changed $$ to $i.)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
#!/bin/bash

mkdir -p /tmp/time
cd /tmp/time

# vim-plug ================================================

curl -s -fLo /tmp/time/plug.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

rm -rf /tmp/time/plug-bundle
mkdir -p /tmp/time/plug-bundle

cat > plug-vimrc <<EOF
set runtimepath+=/tmp/time/plug.vim

call plug#begin('/tmp/time/plug-bundle')

Plug 'scrooloose/nerdcommenter'
Plug 'altercation/vim-colors-solarized'
Plug 'Shougo/denite.nvim'
Plug 'ervandew/supertab'
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug 'wlangstroth/vim-racket'
Plug 'derekwyatt/vim-fswitch'
Plug 'godlygeek/tabular'
Plug 'dkprice/vim-easygrep'
Plug 'terryma/vim-multiple-cursors'
Plug 'tpope/vim-fugitive'
Plug 'idanarye/vim-merginal'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-endwise'
Plug 'vim-scripts/searchfold.vim'
Plug 'thinca/vim-quickrun'
Plug 'int3/vim-extradite'
Plug 'bronson/vim-visual-star-search'
if executable('ghc-mod')
Plug 'eagletmt/ghcmod-vim'
endif
Plug 'eagletmt/neco-ghc'
Plug 'Shougo/neomru.vim'
Plug 'mattn/webapi-vim'
Plug 'vim-scripts/VisIncr'
Plug 'schickling/vim-bufonly'
Plug 'lambdalisue/vim-gista', {
\ 'on_cmd': 'Gista'
\}
Plug 'kchmck/vim-coffee-script'
Plug 'digitaltoad/vim-jade'
Plug 'honza/dockerfile.vim'
Plug 'rhysd/clever-f.vim'
Plug 'tpope/vim-sleuth'
Plug 'ton/vim-bufsurf'

Plug 'guns/vim-sexp'
Plug 'tpope/vim-repeat'
call plug#end()
EOF

echo "vim plug cold install in seconds"
/usr/bin/time -f %e \
nvim -u /tmp/time/plug-vimrc -i NONE -c "PlugInstall" -c quit -c quit
echo "vim plug hot install in seconds"
/usr/bin/time -f %e \
nvim -u /tmp/time/plug-vimrc -i NONE -c "PlugInstall" -c quit -c quit

rm -f plug-vim-*.log
for i in {1..100}
do
nvim \
-u plug-vimrc -i NONE \
--startuptime plug-vim-$i.log \
-c quit
done

echo "vim-plug max/min/mean in miliseconds"
for file in plug-vim-*.log
do
awk 'END {print $1}' "$file"
done \
| awk '
NR == 1{
max = $1
min = $1
}
{
sum += $1
if ($1 > max) max = $1
if ($1 < min) min = $1
}
END {
if (NR == 0) exit
print max
print min
print sum / NR
}'

# dein.vim ================================================

rm -rf dein.vim
git clone -q --depth 1 https://github.com/Shougo/dein.vim.git

rm -rf /tmp/time/dein-bundle
mkdir -p /tmp/time/dein-bundle

cat > dein-vimrc <<EOF
if &compatible
set nocompatible
endif
set runtimepath+=/tmp/time/dein.vim

if dein#load_state('/tmp/time/dein-bundle')
call dein#begin('/tmp/time/dein-bundle')
call dein#add('/tmp/time/dein.vim')

call dein#add('scrooloose/nerdcommenter')
call dein#add('altercation/vim-colors-solarized')
call dein#add('Shougo/denite.nvim')
call dein#add('ervandew/supertab')
call dein#add('SirVer/ultisnips')
call dein#add('honza/vim-snippets')
call dein#add('wlangstroth/vim-racket')
call dein#add('derekwyatt/vim-fswitch')
call dein#add('godlygeek/tabular')
call dein#add('dkprice/vim-easygrep')
call dein#add('terryma/vim-multiple-cursors')
call dein#add('tpope/vim-fugitive')
call dein#add('idanarye/vim-merginal')
call dein#add('tpope/vim-surround')
call dein#add('tpope/vim-endwise')
call dein#add('vim-scripts/searchfold.vim')
call dein#add('thinca/vim-quickrun')
call dein#add('int3/vim-extradite')
call dein#add('bronson/vim-visual-star-search')
if executable('ghc-mod')
call dein#add('eagletmt/ghcmod-vim')
endif
call dein#add('eagletmt/neco-ghc')
call dein#add('Shougo/neomru.vim')
call dein#add('mattn/webapi-vim')
call dein#add('vim-scripts/VisIncr')
call dein#add('schickling/vim-bufonly')
call dein#add('lambdalisue/vim-gista', {
\ 'on_cmd': 'Gista'
\})
call dein#add('kchmck/vim-coffee-script')
call dein#add('digitaltoad/vim-jade')
call dein#add('honza/dockerfile.vim')
call dein#add('rhysd/clever-f.vim')
call dein#add('tpope/vim-sleuth')
call dein#add('ton/vim-bufsurf')

call dein#add('guns/vim-sexp')
call dein#add('tpope/vim-repeat')
call dein#end()
call dein#save_state()
endif

filetype plugin indent on
syntax enable
EOF

echo "dein.vim cold install in seconds"
/usr/bin/time -f %e \
nvim -u /tmp/time/dein-vimrc -i NONE -c "silent call dein#install()" -c quit
echo "dein.vim hot install in seconds"
/usr/bin/time -f %e \
nvim -u /tmp/time/dein-vimrc -i NONE -c "silent call dein#install()" -c quit

rm -f dein-vim-*.log
for i in {1..100}
do
nvim \
-u dein-vimrc -i NONE \
--startuptime dein-vim-$i.log \
-c quit
done

echo "dein.vim max/min/mean in miliseconds"
for file in dein-vim-*.log
do
awk 'END {print $1}' "$file"
done \
| awk '
NR == 1{
max = $1
min = $1
}
{
sum += $1
if ($1 > max) max = $1
if ($1 < min) min = $1
}
END {
if (NR == 0) exit
print max
print min
print sum / NR
}'

Restult on my box:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
$ ./bench.sh
vim plug cold install in seconds
4.68
vim plug hot install in seconds
0.52
vim-plug max/min/mean in miliseconds
196.383
093.609
155.931
dein.vim cold install in seconds
8.11
dein.vim hot install in seconds
0.28
dein.vim max/min/mean in miliseconds
188.966
130.138
162.828

Test env:

1
2
nvim 0.2.0-dev
Ubuntu 14.04

So, dein is a bit slower for installing from scratch. Both are super fast. Great work to both authors.