From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: How to measure frame rate in fps? Date: Tue, 01 Jun 2021 17:43:49 +0300 Message-ID: <83y2btzlui.fsf@gnu.org> References: <83h7ih24kc.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15600"; mail-complaints-to="usenet@ciao.gmane.io" Cc: wyuenho@gmail.com, emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jun 01 16:44:58 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lo5da-0003qG-3z for ged-emacs-devel@m.gmane-mx.org; Tue, 01 Jun 2021 16:44:58 +0200 Original-Received: from localhost ([::1]:45020 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lo5dZ-0004eK-7j for ged-emacs-devel@m.gmane-mx.org; Tue, 01 Jun 2021 10:44:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60264) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lo5ck-0003xe-VP for emacs-devel@gnu.org; Tue, 01 Jun 2021 10:44:07 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:58752) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lo5ck-00082y-C4; Tue, 01 Jun 2021 10:44:06 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4258 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lo5cj-0005nW-UG; Tue, 01 Jun 2021 10:44:06 -0400 In-Reply-To: (message from Dmitry Gutov on Tue, 1 Jun 2021 17:18:09 +0300) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:270198 Archived-At: > Cc: emacs-devel@gnu.org > From: Dmitry Gutov > Date: Tue, 1 Jun 2021 17:18:09 +0300 > > On 01.06.2021 14:43, Eli Zaretskii wrote: > > You just need to remember to include some command that > > would affect the display, or else redisplay will do very little and > > redraw nothing. > > Speaking of redisplay redrawing nothing, as long as tool-bar-mode is on, > my GTK3 build (with -Q even) evaluates (benchmark 1 '(redisplay)) to a > sequence of results like this: > > Elapsed time: 0.040924s > Elapsed time: 0.026343s > Elapsed time: 0.023473s > Elapsed time: 0.025162s > Elapsed time: 0.030074s > Elapsed time: 0.041305s (0.026917s in 1 GCs) > Elapsed time: 0.031169s > Elapsed time: 0.020957s > Elapsed time: 0.034885s > Elapsed time: 0.035338s > Elapsed time: 0.030864s > > and with tool-bar-mode off: > > Elapsed time: 0.007189s > Elapsed time: 0.006181s > Elapsed time: 0.007358s > Elapsed time: 0.004177s > Elapsed time: 0.007754s > Elapsed time: 0.007557s I know very little about the cost of the GTK tool bar redrawing: the code is in gtkutil.c, and it's full of GTK API calls. Maybe the above times are explained and justified by that, I don't know. I also am not sure the above faithfully reflects what happens in Real Life when Emacs has nothing to redisplay: I think you get the tool-bar redisplay triggered because the evaluation of the benchmark call causes it somehow. How did you evaluate it, exactly? > Not so noticeable if it just happens once, but easily affects the > performance of code which performs "virtual" redisplay, such as > posn-at-point. How do you deduce that posn-at-point triggers redisplay of the GTK tool bar? It shouldn't, AFAIR. posn-at-point and its ilk only simulate display of text, they don't care about window's and frame's decorations.