EdenEast / nightfox.nvim

🦊A highly customizable theme for vim and neovim with support for lsp, treesitter and a variety of plugins.
MIT License
2.91k stars 136 forks source link

v3.4.0 increased start-up times? (even after compilation) #330

Closed leitdeux closed 1 year ago

leitdeux commented 1 year ago

Thanks for your hard work on this awesome theme.

When I measured start-up time of Neovim (via :StartupTime, https://github.com/tweekmonster/startuptime.vim), v3.3.0 of Nightfox was taking on average for me 0.5 ms on start-up, whereas v3.4.0 is now for me somewhere between 18~20ms. I can confirm that my themes were indeed compiled when I upgraded to v3.4.0, and also tried removing the plugin and cache and re-installing to see if that would help but I'm still seeing that same higher start-up time. Of course it's not a deal-breaker or anything, just something I noticed. I experience these longer start-up times in both Neovim v0.8.3 and v0.9.0 on macOS 13.0.

v.3.3.0 (upon running :StartupTime) nightfox-3 3 0

v.3.4.0 nightfox-3 4 0

EdenEast commented 1 year ago

Doing some investigations and profiling it seems that the setup guard that was used to make sure the setup function was called so that the cache hash could be compiled was causi

Interesting. I did some investigations and found that the setup guard was causing cache misses every time. The setup guard is used so that if load is called without setup being called it would call setup to have the cache loaded. Moving the setup guard to before the load and setup functions seems to solve the issue.

EdenEast commented 1 year ago

@leitdeux I created a PR #331 with a fix. Can you confirm that this solves your issue.

leitdeux commented 1 year ago

Yes that fixes it-- I'm seeing sub-millisecond loading times again when I call :StartupTime. Thanks very much!