Closed pickfire closed 9 years ago
I'm not familiar with this. I guess it's close to Tomorrow theme since I modified from it. How is the speed compared to other color schemes like Solarized or Gruvbox?
I use base16, it seems like base16 is faster.
724.645 162.297 157.190: sourcing /home/ivan/.vim/plugged/base16-vim/colors/base16-solarized.vim
Just take a look at the third field.
It seems it is even slower in neovim.
3038.269 2713.668 2705.840: sourcing /home/ivan/.nvim/plugged/papercolor-theme/colors/PaperColor.vim
How do you do the test?
--startuptime? my result is 156ms and gruvbox only takes 35ms.
I mean, how do you get the number? what tool did you use so I can use to test?
my result is 156ms and gruvbox only takes 35ms.
I am using Raspberry Pi 2, so that is why I am getting slow results.
You can do it with just:
vim --startuptime log.txt
:q
less log.txt
I mean, how do you get the number?
The numbers are actually in the log.txt file.
There is actually a vim plugin than can do this, but it seems that it is not working recently.
Another way:
I think the reason why papercolor is slow is because that it has 1000+ lines, base-16 only have 300+ lines and some random colorscheme I found is only about 100 lines.
Partly because of that, but more precisely, it's the number of function calls and string processing on each line of the design section. It's from Tomorrow theme, and the way it does is not necessary for PaperColor. I have some idea of how to make it load a lot faster. I'll do it sometime in the future.
I suggest to look in base16 and jellybeans, I used base16 and found out that it have good startup time, which is about half of the time compared to papercolor. I suggest jellybeans because the author of vim-hybrid found out jellybeans have good colorscheme or something else.
Hi, it seems that papercolor startup time is slowed down by functions computing terminal 256 palette fallbacks (CSApprox like behaviour).
Dropping out " ctermfg=" . <SID>rgb(a:fg)
and " ctermbg=" . <SID>rgb(a:bg)
speeds up runtime from ~100ms to ~12ms.
Gruvbox mean load time is ~50ms for me, so I should probably think about optimising at a bit too.
I hope that it can just use True Colors if the terminal support truecolors.
Hi, it seems that papercolor startup time is slowed down by functions computing terminal 256 palette fallbacks (CSApprox like behaviour).
I am not sure about that, need to ask @NLKNguyen about it.
What do you mean Gruvbox?
@pickfire gruvbox colorscheme average load time
Gruvbox colorscheme have nice colour but it seems that the screenshot is not so good. And it seems too yellow for light colorscheme:
Does gruvbox has support for true colors?
@pickfire If you have gruvbox issues, please:
It's not polite asking well known and documented questions at other project's issues.
Sorry, but I hope @morhetz can fix this issue and create a pull request to @NLKNguyen.
@morhetz Thanks for pointing out :+1:. Since this colorscheme is based on 256-color (although there are still some leftover color codes from Tomorrow-theme), the programmatic conversion from true color to 256-color can be avoided.
I plan to do it manually by hand like this for example. It's essentially the fallback method you mentioned, except they are the same color by design.
let s:pink = ["#d7005f", 161]
Then use s:pink[0]
for gui*
and s:pink[1]
for cterm*
I will create a branch to work on this soon.
P.S. Thanks for you theme. I got help on light-dark-toggling from someone who studied your code :)
@NLKNguyen Thanks :) PaperColor is very-very nice and heavily tuned. It's always а pleasure to read sources of thoroughly made colorscheme.
Then use s:pink[0] for gui* and s:pink[1] for cterm*
That's the way I've just roughly optimised gruvbox. Average load time dropped from ~50 to ~20. It's not release ready yet, but you could take some inspiration from s:HL function.
I just improved the speed. Apparently, it gets 7x speed up from ~100 to ~14 on my computer. Guys, please let me know how it performs on yours. @morhetz when yours is ready, I like to test Gruvbox startup speed on my computer as well.
Wow, congratulations! I get 14x faster here.
Before:
3038.269 2713.668 2705.840: sourcing /home/ivan/.nvim/plugged/papercolor-theme/colors/PaperColor.vim
After:
801.110 195.138 190.100: sourcing /home/ivan/.vim/plugged/papercolor-theme/colors/PaperColor.vim
Do you think I should close this issue or you want it as a reminder?
Great haha :+1:
I'll close this after a few days in case of further discussion.
@NLKNguyen it's 10.250 with papercolor vs 7.025 with gruvbox for me, and i doubt it matters :)
though you could also pseudo-memoize common groups to hi! link CommonGroupName
to decrease calculations, string concatenations time, etc.
Great! I just leave it like that for now since It's fast enough :D
I had found out that PaperColor Theme slows down the startup. Full log here: http://pastie.org/private/fpfzj8opftoqgsohpvng
I hope you can speed it up. Thanks.