Profile startup time

#1

Hello all, this is my first post here.

I’m wondering if anyone has found a good way to profile Kakoune’s startup time. I’ve been using time kak -e "exec 'gj:q<ret>'" ~/some/file for a general metric, but that’s not very useful for figuring out which kak scripts are slow.

Ideally, what I’d like is something like the vim --startuptime option, that would record the time it takes to source each kak file, and put it into a file or the scratch buffer.

#2

When I’ve profiled my plugin manager, I’ve added shell code to record time directly to scripts to see what time it takes to load various plugins

#3

Hmm, I has hoping for something a little more built-in than that. Maybe it sounds more complicated than it is. Could you give me an example?

I found on github, that you can set set global debug profile. When I tried it, it worked and gave some good results in the debug buffer, but didn’t stop printing and Kakoune crashed.

Do you know if there’s any documentation on these debugging features?

#4

I wasn’t using this because it was providing too much info in my case.

My usage was a bit ugly, I’ve used time command with nanoseconds, and saved the start time, and end time, then calculated the difference. I understand that this isn’t the most accurate way to measure, but for my needs it provided sane results and I was able to track major speedups while optimizing the code.

#5

I wish that there would be something like emacs-init-time but a variable that provides a number of seconds that took to start Kakoune.