Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Startup time #74

Open
sudoremo opened this issue Jan 31, 2018 · 9 comments
Open

Startup time #74

sudoremo opened this issue Jan 31, 2018 · 9 comments

Comments

@sudoremo
Copy link

This plugin significantly adds to my vim / nvim startup time by contributing 328ms to it. Is this a known issue / is there any way to improve this startup time?

Thanks for any help and also thanks for this wonderful plugin - it was the first vim plugin I used back when I switched from Atom! 👍

@rakr
Copy link
Owner

rakr commented Feb 10, 2018

This issue has not yet been reported, will need some investigation.

@rnevius
Copy link

rnevius commented Jan 8, 2019

Just bumping this issue with the results of my profiler:

vim-one load time
Vim 233.36 ms
Neovim 82.64 ms

@geoffharcourt
Copy link
Contributor

geoffharcourt commented Jan 22, 2019

I think this performance hit on startup (even when the scheme isn't active) is due to the use of functions to define the colors vs. hard-coded values. It would be a non-trivial effort to rewrite those (I think this was built from the base16 generator originally), but that might be a contributor.

h/t @devinrm for the suggestion.

@geoffharcourt
Copy link
Contributor

I should clarify that I don't think this is easy, and it might reduce the comprehensiveness of the scheme, limiting the size of the group that can use it.

@laggardkernel
Copy link

@geoffharcourt Thx for your explanation. I just made a hard-coded fork of vim-one and the startup time improves dramatically.

# the original one
❯ vim-profiler.py -r 10 nvim
=====================================
Top 10 plugins slowing nvim's startup
=====================================
1       170.621   vim-one
2         6.274   vim-airline
3         4.038   vim-polyglot
4         3.496   coc.nvim
5         2.645   colorizer
6         2.413   vim-textobj-xmlattr
7         2.313   vim-textobj-comment
8         1.795   vim-sensible
9         1.664   vim-textobj-line
10        1.341   ctrlp.vim
=====================================

# the hard-coded
❯ vim-profiler.py -r 10 nvim
=====================================
Top 10 plugins slowing nvim's startup
=====================================
1        11.172   vim-one
2         6.650   vim-airline
3         3.960   vim-polyglot
4         3.579   coc.nvim
5         2.830   colorizer
6         2.405   vim-textobj-comment
7         2.372   vim-textobj-xmlattr
8         1.732   vim-sensible
9         1.724   vim-textobj-line
10        1.430   ctrlp.vim
=====================================

Italic setting let g:one_allow_italics = 1 is available.

@geoffharcourt
Copy link
Contributor

@laggardkernel did you have a script or programmatic way to do this?

@laggardkernel
Copy link

@geoffharcourt No, not yet.

I used command nvim -u only-for-one.vim -V20output.log to get the verbose sourcing info during nvim startup. The configuration file only-for-one.vim only included the vim-one plugin and some colorscheme settings. After that, I did some searching in the output file and extract all the related highlight statements from it.

As far as I know, it's the most simple way to convert the original project to a hard-coded color scheme. Maybe I'll restructure the code later. Haven't made up my mind.

@rakr
Copy link
Owner

rakr commented Apr 9, 2019

Thanks for your patience, thanks to @laggardkernel and the use of better approximation, this issue should now be fixed by the latest commit to master.
@laggardkernel As commented on the PR, I had to manually merge the PR, Thank you very much for your contribution

@laggardkernel
Copy link

@rakr Thank God you're back. There's another optimization I borrowed from vim theme gruvbox that reuses highlight definitions by hi link. Maybe we could add it as well. I'll rebase it onto the master branch and open a pr once I have a spare moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants