chriskempson / vim-tomorrow-theme

Tomorrow Theme for Vim
http://github.com/chriskempson/tomorrow-theme
285 stars 141 forks source link

Theme slows vim startup #46

Open saladpanda opened 8 years ago

saladpanda commented 8 years ago

I did some profiling with https://github.com/hyiltiz/vim-plugins-profile and found that vim-tomorrow-theme has a surprisingly high impact on vim's startup-time:

==========================================
Top 10 Plugins That Slows Down Vim Startup
==========================================
     1  "ExecTime"      "PluginName"
     2  52.485  "tomorrow-theme"
     3  5.741   "vim-airline"
     4  5.228   "nerdcommenter"
     5  1.929   "vim-gitgutter"
     6  1.347   "vim-sensible"
     7  1.175   "ultisnips"
     8  1.013   "supertab"
     9  0.902   "ctrlp.vim"
    10  0.649   "youcompleteme"
==========================================

while other themes like e.g. Zenburn need way less time:

==========================================
Top 10 Plugins That Slows Down Vim Startup
==========================================
     1  "ExecTime"      "PluginName"
     2  5.227   "nerdcommenter"
     3  4.772   "vim-airline"
     4  2.051   "vim-gitgutter"
     5  1.676   "Zenburn"
     6  1.383   "vim-sensible"
     7  1.197   "ultisnips"
     8  1.105   "supertab"
     9  0.927   "ctrlp.vim"
    10  0.806   "Vundle.vim"
==========================================

EDIT: Heres a result with tomasr/molokai (this time measured with bchretien/vim-profiler):

====================================
Top 10 plugins slowing vim's startup
====================================
1         5.716   vim-airline
2         2.518   vim-gitgutter
3         1.767   vim-sensible
4         1.610   molokai
5         1.596   ultisnips
6         1.510   supertab
7         1.109   ctrlp.vim
8         0.886   youcompleteme
9         0.874   vim-surround
10        0.522   vim-multiple-cursors
====================================

What makes this theme so slow?

tbodt commented 5 years ago

Because for each color it sets up, it runs 20 lines of vimscript to compute the nearest terminal color from an RGB value.

iiey commented 4 years ago

Maybe someone could dig into the optimization of NLKNguyen/papercolor-theme#28 (which more or less related to this project)

jsit commented 4 years ago

Because these colors never change, the 8-bit colors that result from those functions shouldn't change, either; they could probably just be hard-coded.

jsit commented 4 years ago

This is now fixed in my active fork (jsit/vim-tomorrow-theme#3)

iiey commented 4 years ago

awesome that was so fast, thank you very much