Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: profile prompt rendering time



On 13/07/16 11:17 -0300, Filipe Silva wrote:
Hi,

short version: How can I profile each rendering of a zsh prompt?

long version: I've recently came across a plugin (rupa/z) that, when
installed, hit my zsh prompt rendering time by a noticeable amount.

When I say prompt rendering time, I'm not refering to amount of time that
it takes for the first zsh prompt to appear when I issue, for an example,
`exec zsh` (that is achieve by issuing `time zsh -i -c "print -n"`).

I'm talking about the time that it takes for zsh to give me another prompt
once that it is fully loaded. In other words, I want to achieve this:

~ $ ls (when i hit enter, start counting)
code/ notes/ file.txt
~ $ (stop counting when this prompt appears. show me elapsed time)

Is that a way to do that?

thanks in advance,

Filipe Silva

You could do something fairly janky and just wrap your whole prompt in a
function that emits the prompt, and time(1)'s itself.



Messages sorted by: Reverse Date, Date, Thread, Author