From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2036 invoked by alias); 13 Jul 2016 21:37:21 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21769 Received: (qmail 4092 invoked from network); 13 Jul 2016 21:37:21 -0000 X-Qmail-Scanner-Diagnostics: from out5-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(66.111.4.29):SA:0(0.0/5.0):. Processed in 0.113653 secs); 13 Jul 2016 21:37:21 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: richo@psych0tik.net X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at psych0tik.net does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=psych0tik.net; h= content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=KrIFt Pv7O/PkcPxCECuaU3U1Amg=; b=jaX/0AP0qOPc/lM6oYyfVacgXqxISp9Ve27IF mFMj2tZBufgMD6hPq/ZSj6ZQLdob0sXvtHZdWOqhZsVJGrR0LGX+lgGjXmLnaVme PhRPqq/u9FumlrnjS06v6hJQ+A/O9nUpS/weZIBkKam+KIvXPdQMM5Uk87Zk6c4I aBS6wE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=KrIFtPv7O/PkcPxCECuaU3U1Amg=; b=IRcFg 6xYjRbyG3DJGSnZKEYV27TzZRyVuDaw2JuXjSEbJmJWTpdO9xITCJCFYkIXmKwM7 6AQw5dQ/Sc79pkp6dwfv1uZDqt74cwYVanq2cKF/l11mLaPXucvDmlHUiQ2qzrez xNyVlHvaf6gPuJWiA8vEtF/uHxnrCl/JsVzbZU= X-Sasl-enc: 2V2HDbZVAURR3FumJF11dIWwjYdC5Vf96/DlTyBpX77a 1468445835 Date: Wed, 13 Jul 2016 14:37:13 -0700 From: Richo Healey To: zsh-users@zsh.org Subject: Re: profile prompt rendering time Message-ID: <20160713213713.GB75349@xenia> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) 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.