Recently, @mralusv added a new command, called plug-chain. It allows chaining plug commands into one long command, that only invokes the shell once. As a result, the startup time is improved. Huge thanks to @mralusv for working on this feature.
I’ll be cutting v2.1.0 release soon, but this is already available on the main repository branch, and I welcome everyone to test this feature, and see if it improves startup time of your configuration. For the reference, here’s my plugin configuration section, altered to use the new plug-chain command: plugins.kak.
plug.kak does a lot of stuff for you under the hood.
It registers hooks for a more convenient lazy loading, encapsulates plugin configuration and handles errors during startup, and so on. The main startup time cost comes from shell invocations needed to load and set up plugins.
@kkga would you care to share your (sanitized) configs? i’m quite interested in startup cost, because when using kak as the $EDITOR or $GIT_EDITOR, anything above 100ms (or something like that) hits the human persistence of vision threshold and becomes an annoyance. Basically, any visible delay puts humans in a different mood (interactive vs planned). Anyway, theory aside, I’d like to find any remaining bottlenecks in plug.kak (and kak-bundle as well).
@kkga something seems to be missing. You seem to be using another plugin manager, cork (possibly at GitHub - topisani/cork.kak — it doesn’t seem to have been announced over here) but I can’t grep any place where it is actually loaded.
Edit: nevermind, cork is unusual in that it needs cork.sh to be renamed into $PATH as cork, and then it is available as a shell (and %sh) command. There is no kak file defining commands.
Edit 2: I can’t find performance ideas in cork, and I’ve had trouble using it (how to install plugins in the first place?). Each and every cork command spawns bash on top of %sh{}, defines kak commands, and executes them. It is of course possible that you have really fast hardware, so we need to compare comparables. In any case, I can’t reproduce as of now; perhaps there should be another thread for this plugin manager.
I actually only started using cork very recently. I’ve always used git-submodules for handling/updating kakoune plugins and then manually sourced them in kakrc.
Cork does provide some niceties around scoping plugin-related options in config files, so that’s my only reason to use it.
I haven’t noticed any changes in startup performance after switching from manual sourcing to cork (although i haven’t measured it).
I can’t find performance ideas in cork, and I’ve had trouble using it (how to install plugins in the first place?).
Plugins are installed by the same command: cork update, which can be run either inside kakoune or from a shell session. I’m running it as a part of system update with topgrade.
It is of course possible that you have really fast hardware, so we need to compare comparables.
The hyperfine results I shared earlier are done on X1 Carbon gen 9 (i5). I’m getting similar results right now on my desktop machine:
UPD: actually there’s one more reason I use cork (over alternatives): it can be run from shell, as I don’t want to manually update plugins from inside Kakoune.