feat: cache colors - #236
Conversation
7e6f443 to
d795b47
Compare
2695008 to
2e545d4
Compare
|
Okay screw this CI-only tool, I've tried my best but if |
|
I love this idea… watching with interest. |
|
I've been using this in different environments (Linux, macOS, Android) for quite a bit of time and it is working fine for me. Would you like to take a look at it when you have the time? @mcchrish |
|
@s-cerevisiae I gave your fork a whirl, and one thing I noticed is that it seemed to break switching between light and dark modes? I could have just integrated it incorrectly. |
|
Aww good catch. Looks like a dumb mistake in my code, I'll fix it soon |
|
Found another bug in the process... I'll fix both |
fix switching from randombones to other colors
|
@evantravers I got both problems fixed, you can give it another go. Thanks for testing it! |
|
That seems to work. My (lazy-as-heck) AI analysis of the Here's the zenbones theme load comparison (from the Embedded process profiles): zenbones load block (bones.vim → colors/zenbones.vim) Savings: ~10.2 ms, roughly 8.5× faster. What's happening differently before-cache — full lush compile path (~11.6 ms): cache.txt — just reads the precompiled output: The cache path skips the entire lush/vivid compilation chain (lush, lush.parser, As a side effect, total startup dropped too: NVIM STARTED at 062.696 → 056.899 (~5.8 ms |
This PR adds cache for colors and palettes, following the practice of
tokyonight.nvim. Colorschemes are compiled into a messagepack table on first load, and subsequent loads doesn't loadlush.nvimat all. The startup time is reduced to ~2ms on my machine (on par with pre-compiled solution in #235), while allowing for configuration.Note: a
versionfield is added tozenbones.utilwhich is expected to be updated byrelease-please. Not sure if it works this way.Fixes #98.
TODO:
Refactor each colorscheme so thatNot necessary as this only happens once per cache writeget_global_configis not called twiceterm.lua?