unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Jan Djärv" <jan.h.d@swipnet.se>
Cc: ericfroemling@gmail.com, 17124@debbugs.gnu.org
Subject: bug#17124: 24.3.50; Occasional Extremely Slow Redraws in OSX Emacs
Date: Fri, 27 Jun 2014 22:57:23 +0300	[thread overview]
Message-ID: <83r42a6s7w.fsf@gnu.org> (raw)
In-Reply-To: <E198908F-7296-469F-B39F-77F9ADCB3B47@swipnet.se>

> From: Jan Djärv <jan.h.d@swipnet.se>
> Date: Fri, 27 Jun 2014 19:13:00 +0200
> Cc: ericfroemling@gmail.com,
>  17124@debbugs.gnu.org
> 
> >> With the "shake the divider" recepie (see below), redisplay_internal is called more than 30 times per second.  On an old computer (end of 2008) I get about 37 times per second.
> >> But each redisplay results in multiple draw_begin/end, so for drawing, it is more than 37 times per second.
> > 
> > Does it help to set redisplay-dont-pause to nil?
> 
> The "shake the divider" case becomes much worse, lots of flickering and incomplete text.

But do you see less drawing requests sent to the backend?

> > Incidentally, I don't think your suggestion will help in the "shake
> > the divider" scenario: when window dimensions are changed, we toss the
> > glyph matrices of the affected windows, and then allocate them anew
> > (and perform a thorough redisplay of those windows).  So this will
> > anyhow require to redisplay the entire window completely, and the
> > backend will not be able to save us any redraws.
> 
> Not by itself, but if the backend is responsible for when actual drawing happens we can make sure we don't draw faster than the screen can update.

I actually find it hard to believe that we overwhelm the backend,
except, maybe, when the X client is on a remote machine.  E.g., on
Windows the "shake the divider" recipe doesn't show any signs of a
problem, and the CPU load is never more than a single execution unit
being busy, which means not much is at work except Emacs itself.  With
today's multi-core fast machines, how come it's impossible to redraw a
region 37 times a second?

> >> I think there is room for optimizations in the generic display also, for example moving the mouse redraws the entire mode line, even if the mouse pointer is outside the frame.
> > 
> > Please show the recipe to reproduce this.  I just tried a naive way of
> > doing that, and didn't see any mode-line updates even when the mouse
> > is inside the frame.  So I must be missing something.
> > 
> 
> I had problems seeing what was drawn and when so I added debug code to see what the font driver actually draws.  But I see now that it is different for X11.  So it might be NS specific.  What can make the modeline redraw in one version of Emacs and not in another?  I thought all that was generic code.

It _is_ generic code.  Perhaps we are not talking about the same
things: when you say that the mode line is redrawn, what exactly do
you see?

> Well, shake the divider is not really something normal a user does.  It is just a way to force the issue.  But slow redraws happens in normal usage also, i.e. switching buffers and editing.  It solves the second case, but makes shake the divider worse in terms of smooth redraws.

We need to compare the performance with this proposed feature with the
current implementation.  I think it's hard to talk about this without
some measurements, and probably also some reasonably important use
cases (which "shake the divider" isn't, IMO).





  parent reply	other threads:[~2014-06-27 19:57 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-27 21:23 bug#17124: 24.3.50; Occasional Extremely Slow Redraws in OSX Emacs Eric Froemling
2014-03-28  7:20 ` Eli Zaretskii
2014-03-28 16:19   ` Eric Froemling
2014-03-28 17:43     ` Eli Zaretskii
2014-04-01  5:23       ` Eric Froemling
2014-04-01 15:03         ` Eli Zaretskii
2014-04-01 16:57           ` Eric Froemling
2014-06-27 10:44             ` Jan Djärv
2014-06-27 13:37               ` Eli Zaretskii
2014-06-27 17:13                 ` Jan Djärv
2014-06-27 17:30                   ` Eric Froemling
2014-06-27 19:58                     ` Eli Zaretskii
2014-06-27 19:57                   ` Eli Zaretskii [this message]
2014-06-30 12:55                     ` Jan Djärv
2014-06-30 14:45                       ` Eli Zaretskii
2014-03-29 12:20 ` Jan Djärv
2015-01-27 20:09 ` Bill Sacks
2016-02-10 19:25   ` bulldozer
2016-02-10 23:29     ` Alan Third
2016-02-11  0:26       ` bulldozer
2016-02-12  5:10       ` bulldozer
2016-02-12  7:21         ` Eli Zaretskii
2016-02-12 23:54           ` Alan Third
2020-09-09 12:30             ` bug#16594: " Lars Ingebrigtsen

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=83r42a6s7w.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=17124@debbugs.gnu.org \
    --cc=ericfroemling@gmail.com \
    --cc=jan.h.d@swipnet.se \
    /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).