gmarik/vundle — Issue #124: Vundle is much slower than NeoBundle
Author: zhaocai
Created: 2011-12-18 03:29:59+00:00
State: open

Hi, guys

I just tried [NeoBundle][] and surprisingly found that neobundle loaded much faster than [vundle][]. As a matter of fact, neobundle was originally based on [vundle][]. The profiling process and command are detailed as below for you reference.

If you are interested, please try it yourself and share the results...

Profiling Command
------------
```sh
vim --cmd 'profile start profile.log' \
--cmd 'profile func *' \
--cmd 'profile file *' \
-c 'profdel func *' \
-c 'profdel file *' \
-c 'qa!'
```

vimrc diff
----------
same vimrc containing 50+ bundles. The only difference are a few lines to load [vundle][] or neobundle.

```vim
if has('vim_starting')
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
let g:vundle_win_width = 36
endif

Bundle 'gmarik/vundle'
```

```vim
if has('vim_starting')
set runtimepath+=~/.vim/bundle/neobundle.vim/
call neobundle#rc(expand('~/.vim/bundle/'))
command! -nargs=+ Bundle
\ call neobundle#config#bundle()
endif

NeoBundle 'Shougo/neobundle.vim'
```

testing results
---------------
Please check the **top lines** for each profiling results.

+ vundle

```
FUNCTIONS SORTED ON TOTAL TIME
count total (s) self (s) function
103 0.942041 0.001915 vundle#config#bundle()
103 0.494629 0.029297 4_rtp_add_a()
104 0.434962 0.028427 4_rtp_rm_a()
5356 0.345058 4_rtp_add()
5253 0.288478 4_rtp_rm()
10609 0.238331 0.071125 2()
10609 0.167206 0.055477 1()
10609 0.111729 4_expand_path()
1 0.065721 0.000963 103_browse_check()
2 0.054499 0.002833 vital#of()
1 0.042505 0.000064 131_SetWatchExtension()
1 0.042441 0.000061 131_CreateDict()
1 0.042380 0.011695 131_ParseFileAssociationList()
1 0.041924 0.000028 vital#_c7f20e#new()
2 0.041896 0.000126 191_import()
4 0.034772 0.024908 DoxygenReadTemplates()
3 0.032555 0.015258 191__scripts()
3 0.029177 0.000403 191__import()
13 0.028053 TagHighlight#LoadDataFile#LoadFile()
2 0.027475 0.002766 zlib#sys#ostype()

FUNCTIONS SORTED ON SELF TIME
count total (s) self (s) function
5356 0.345058 4_rtp_add()
5253 0.288478 4_rtp_rm()
10609 0.111729 4_expand_path()
10609 0.238331 0.071125 2()
10609 0.167206 0.055477 1()
103 0.494629 0.029297 4_rtp_add_a()
104 0.434962 0.028427 4_rtp_rm_a()
13 0.028053 TagHighlight#LoadDataFile#LoadFile()
4 0.034772 0.024908 DoxygenReadTemplates()
3 0.026625 0.022328 191__build_module()
19 0.019326 0.018752 126_createtimehandler()
577 0.015858 191__unify_path()
3 0.032555 0.015258 191__scripts()
57 0.013005 131_IsInDict()
1 0.042380 0.011695 131_ParseFileAssociationList()
103 0.007290 4_parse_name()
1 0.009286 0.005968 131_CheckLinks()
6 0.005852 191__redir()
186 0.005455 131_Trim()
3 0.005856 0.005276 41__build_module()
```

+ neobundle

```
FUNCTIONS SORTED ON TOTAL TIME
count total (s) self (s) function
1 0.066579 0.000623 141_browse_check()
3 0.058909 0.002727 vital#of()
1 0.042700 0.000025 vital#_c7f20e#new()
2 0.042675 0.000119 193_import()
1 0.040882 0.000043 113_SetWatchExtension()
1 0.040839 0.000061 113_CreateDict()
1 0.040778 0.011425 113_ParseFileAssociationList()
4 0.034289 0.024681 DoxygenReadTemplates()
3 0.032798 0.015414 193__scripts()
3 0.030485 0.000426 193__import()
13 0.028208 TagHighlight#LoadDataFile#LoadFile()
3 0.028024 0.023446 193__build_module()
2 0.027718 0.002674 zlib#sys#ostype()
103 0.026822 0.002443 neobundle#config#bundle()
1 0.026240 0.000118 DoxygenRereadTemplates()
1 0.021219 0.001987 71_LoadKinds()
1 0.020836 0.000109 193_load()
19 0.020401 0.001387 118_adddate()
1 0.019232 0.000056 TagHighlight#LoadDataFile#LoadDataFile()
19 0.019014 0.018467 118_createtimehandler()

FUNCTIONS SORTED ON SELF TIME
count total (s) self (s) function
13 0.028208 TagHighlight#LoadDataFile#LoadFile()
4 0.034289 0.024681 DoxygenReadTemplates()
3 0.028024 0.023446 193__build_module()
19 0.019014 0.018467 118_createtimehandler()
583 0.016030 193__unify_path()
3 0.032798 0.015414 193__scripts()
57 0.012847 113_IsInDict()
1 0.040778 0.011425 113_ParseFileAssociationList()
103 0.009645 4_parse_name()
103 0.008889 4_rtp_add()
6 0.006060 193__redir()
1 0.008992 0.005763 113_CheckLinks()
3 0.006385 0.005713 43__build_module()
186 0.005328 113_Trim()
1 0.004271 124_FencCreateMenu()
103 0.015490 0.003813 neobundle#config#init_bundle()
133 0.003378 43__unify_path()
3 0.006961 0.003348 43__scripts()
40 0.002860 zlib#rc#script_load_guard()
3 0.058909 0.002727 vital#of()
```

[NeoBundle]: https://github.com/Shougo/neobundle.vim "neobundle"
[vundle]: https://github.com/gmarik/vundle "vundle"