From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#17124: 24.3.50; Occasional Extremely Slow Redraws in OSX Emacs Date: Fri, 27 Jun 2014 22:57:23 +0300 Message-ID: <83r42a6s7w.fsf@gnu.org> References: <3720C794-D850-4F7A-B5C4-1BC1A72BA26B@gmail.com> <83a9cayekp.fsf@gnu.org> <7D2257F7-2E81-44C8-9DC7-6A837BF43DAB@gmail.com> <837g7efcc4.fsf@gnu.org> <83d2h1ccsp.fsf@gnu.org> <83wqc279sh.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8BIT X-Trace: ger.gmane.org 1403899113 26644 80.91.229.3 (27 Jun 2014 19:58:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 27 Jun 2014 19:58:33 +0000 (UTC) Cc: ericfroemling@gmail.com, 17124@debbugs.gnu.org To: Jan =?UTF-8?Q?Dj=C3=A4rv?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 27 21:58:24 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1X0cHp-0006gq-2c for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Jun 2014 21:58:17 +0200 Original-Received: from localhost ([::1]:52307 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0cHo-0005pQ-Lk for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Jun 2014 15:58:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46055) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0cHf-0005n6-TC for bug-gnu-emacs@gnu.org; Fri, 27 Jun 2014 15:58:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X0cHa-0006nv-28 for bug-gnu-emacs@gnu.org; Fri, 27 Jun 2014 15:58:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44187) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0cHZ-0006nr-VP for bug-gnu-emacs@gnu.org; Fri, 27 Jun 2014 15:58:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1X0cHZ-0001WD-LM for bug-gnu-emacs@gnu.org; Fri, 27 Jun 2014 15:58:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 Jun 2014 19:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17124 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 17124-submit@debbugs.gnu.org id=B17124.14038990675813 (code B ref 17124); Fri, 27 Jun 2014 19:58:01 +0000 Original-Received: (at 17124) by debbugs.gnu.org; 27 Jun 2014 19:57:47 +0000 Original-Received: from localhost ([127.0.0.1]:35336 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X0cHK-0001Vg-3P for submit@debbugs.gnu.org; Fri, 27 Jun 2014 15:57:46 -0400 Original-Received: from mtaout24.012.net.il ([80.179.55.180]:47777) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X0cHG-0001VK-Ht for 17124@debbugs.gnu.org; Fri, 27 Jun 2014 15:57:44 -0400 Original-Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0N7U00J00F4OAI00@mtaout24.012.net.il> for 17124@debbugs.gnu.org; Fri, 27 Jun 2014 22:53:40 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N7U00IF2F9GBU10@mtaout24.012.net.il>; Fri, 27 Jun 2014 22:53:40 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:90913 Archived-At: > From: Jan Djärv > 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).