unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>
Cc: wyuenho@gmail.com, emacs-devel@gnu.org
Subject: Re: How to measure frame rate in fps?
Date: Mon, 7 Jun 2021 02:31:50 +0300	[thread overview]
Message-ID: <bc050224-45f1-bcde-cdeb-3fc5f197fc5a@yandex.ru> (raw)
In-Reply-To: <83sg1uhpw2.fsf@gnu.org>

On 06.06.2021 20:19, Eli Zaretskii wrote:
>> Cc: wyuenho@gmail.com, emacs-devel@gnu.org
>> From: Dmitry Gutov <dgutov@yandex.ru>
>> Date: Sun, 6 Jun 2021 19:48:17 +0300
>>
>> On 06.06.2021 15:36, Eli Zaretskii wrote:
>>
>>> Then I don't see how this is relevant to the issue with the GTK tool
>>> bar making "do-nothing" redisplays more expensive.  The above is a
>>> completely different scenario; depending on what exactly was Emacs
>>> doing in this scenario, redrawing of the GTK tool bar could indeed
>>> account for an insignificant percentage of the CPU time.
>>
>> In my scenario the observable window configuration doesn't change
>> between redisplays (though, of course, "current buffer" is switched
>> multiple times under the covers, to send request and parse/receive
>> response), and the values of point (again, during redisplay), are only 1
>> character position apart.
> 
> First, that nothing changes on the glass doesn't mean redisplay isn't
> working, because it isn't (always) omniscient.

Of course.

> More importantly, I no longer understand what are we discussing.
> AFAIU, you have some scenario where Emacs is performing some
> non-trivial processing, and where in your opinion redisplay should not
> have changed anything on display.  Is that correct?  If so, please
> take me from this point and explain what is the issue you see.

I have one scenario, which I run with toolbar disabled, then enabled, 
then disabled, then enabled again. With a (benchmark-progn ...) wrapped 
around a (redisplay) call, to note how long it really takes in practice.

I'm saying that the buffer, or other window configuration, don't change 
at those points, so the toolbar likely doesn't need to be re-rendered, 
and so the extra overhead is surprising. And that the toolbar taking 
10-15ms to re-render isn't great either in any case.

>> So if there is some caching of the toolbar contents, I don't see why it
>> wouldn't work. I'm also not sure how rendering it can take 10-15 extra
>> milliseconds, but for all I know this could be normal.
> 
> The 10-15 milliseconds was measured in a different situation, AFAIU:
> an idle "emacs -Q".  Is that correct?

It's the difference, computed very roughly. Let me show you the contents 
of the Messages buffer. The times printed are reported by the 
(benchmark-progn (redisplay)) form:

Elapsed time: 0.000250s
Elapsed time: 0.020975s
Elapsed time: 0.021575s
Elapsed time: 0.018466s
Elapsed time: 0.019960s
Elapsed time: 0.019763s
Elapsed time: 0.018882s
Elapsed time: 0.017270s
Elapsed time: 0.021255s
Elapsed time: 0.008013s
Elapsed time: 0.027652s
Elapsed time: 0.025234s
Elapsed time: 0.016007s
Elapsed time: 0.020156s
Elapsed time: 0.019670s
Elapsed time: 0.016077s
Elapsed time: 0.009564s
Elapsed time: 0.007729s
Elapsed time: 0.010654s
Elapsed time: 0.015931s
Elapsed time: 0.005864s
Tool-Bar mode enabled
Elapsed time: 0.002618s
Elapsed time: 0.029224s
Elapsed time: 0.012488s
Elapsed time: 0.035648s
Elapsed time: 0.034038s
Elapsed time: 0.029158s
Elapsed time: 0.032658s
Elapsed time: 0.031887s
Elapsed time: 0.034134s
Elapsed time: 0.032638s
Elapsed time: 0.033091s
Elapsed time: 0.033695s
Elapsed time: 0.032838s
Elapsed time: 0.023070s
Elapsed time: 0.033654s
Elapsed time: 0.016566s
Elapsed time: 0.028871s
Elapsed time: 0.012279s
Elapsed time: 0.026500s
Elapsed time: 0.027658s
Elapsed time: 0.032699s
Elapsed time: 0.013483s
Elapsed time: 0.030350s
Elapsed time: 0.030031s
Elapsed time: 0.045297s
Elapsed time: 0.025866s
Elapsed time: 0.032220s
Elapsed time: 0.012934s
Elapsed time: 0.032216s
Elapsed time: 0.031713s
Elapsed time: 0.030811s
Elapsed time: 0.013024s
Elapsed time: 0.032237s
Elapsed time: 0.012812s
Elapsed time: 0.021457s
Elapsed time: 0.025366s
Elapsed time: 0.032519s
Elapsed time: 0.025441s
Elapsed time: 0.031464s
Elapsed time: 0.012804s
Elapsed time: 0.012951s
Elapsed time: 0.034065s
Elapsed time: 0.032018s
Elapsed time: 0.033917s
Elapsed time: 0.030410s
Elapsed time: 0.012490s
Elapsed time: 0.034950s
Elapsed time: 0.032683s
Elapsed time: 0.012379s
Elapsed time: 0.017438s
Elapsed time: 0.036289s
Mark set
Quit
Tool-Bar mode disabled
Elapsed time: 0.000336s
Elapsed time: 0.004768s
Elapsed time: 0.018090s
Elapsed time: 0.016751s
Elapsed time: 0.015772s
Elapsed time: 0.006628s
Elapsed time: 0.017676s
Elapsed time: 0.015837s
Elapsed time: 0.021333s
Elapsed time: 0.019190s
Elapsed time: 0.018478s
Elapsed time: 0.018915s
Elapsed time: 0.014479s
Elapsed time: 0.005889s
Elapsed time: 0.022493s
Elapsed time: 0.011403s
Elapsed time: 0.011022s
Elapsed time: 0.020275s
Elapsed time: 0.006469s
Elapsed time: 0.019499s
Elapsed time: 0.005800s
Elapsed time: 0.004827s
Elapsed time: 0.008394s
Elapsed time: 0.029546s
Elapsed time: 0.007446s
Elapsed time: 0.008475s
Elapsed time: 0.008290s
Elapsed time: 0.000402s
Elapsed time: 0.004851s
Elapsed time: 0.019022s
Elapsed time: 0.020623s
Elapsed time: 0.005188s
Elapsed time: 0.021102s
Elapsed time: 0.019203s
Elapsed time: 0.005724s
Elapsed time: 0.019243s
Elapsed time: 0.018614s
Elapsed time: 0.021920s
Elapsed time: 0.019716s
Tool-Bar mode enabled
Elapsed time: 0.002532s
Elapsed time: 0.013393s
Elapsed time: 0.011731s
Elapsed time: 0.033731s
Elapsed time: 0.012756s
Elapsed time: 0.030029s
Elapsed time: 0.011511s
Elapsed time: 0.033465s
Elapsed time: 0.022545s
Elapsed time: 0.023758s
Elapsed time: 0.019158s
Elapsed time: 0.015410s
Elapsed time: 0.039764s
Elapsed time: 0.034458s
Elapsed time: 0.033955s
Elapsed time: 0.029793s
Elapsed time: 0.016531s
Elapsed time: 0.034445s
Elapsed time: 0.024124s
Elapsed time: 0.029344s
Elapsed time: 0.016216s
Elapsed time: 0.031835s
Elapsed time: 0.018600s
Elapsed time: 0.026698s
Elapsed time: 0.013067s
Elapsed time: 0.029260s
Elapsed time: 0.029213s
Elapsed time: 0.013516s
Elapsed time: 0.032331s
Quit [2 times]



  reply	other threads:[~2021-06-06 23:31 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-31 13:03 How to measure frame rate in fps? Jimmy Yuen Ho Wong
2021-06-01 10:00 ` Arthur Miller
2021-06-01 11:43 ` Eli Zaretskii
2021-06-01 14:18   ` Dmitry Gutov
2021-06-01 14:43     ` Eli Zaretskii
2021-06-01 15:00       ` Dmitry Gutov
2021-06-01 15:35         ` Eli Zaretskii
2021-06-01 21:31           ` Dmitry Gutov
2021-06-02  2:29             ` Eli Zaretskii
2021-06-06  2:09               ` Dmitry Gutov
2021-06-06  6:11                 ` Eli Zaretskii
2021-06-06 12:00                   ` Dmitry Gutov
2021-06-06 12:36                     ` Eli Zaretskii
2021-06-06 16:48                       ` Dmitry Gutov
2021-06-06 17:19                         ` Eli Zaretskii
2021-06-06 23:31                           ` Dmitry Gutov [this message]
2021-06-07 12:33                             ` Eli Zaretskii
2021-06-06 18:10                         ` Stefan Monnier
2021-06-06 23:35                           ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bc050224-45f1-bcde-cdeb-3fc5f197fc5a@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=wyuenho@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).