From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Slow redisplay with long lines Date: Fri, 16 May 2014 23:36:43 +0300 Message-ID: <83ppjdea04.fsf@gnu.org> References: <83mwein6w1.fsf@gnu.org> <83ha4qmgbs.fsf@gnu.org> <9711a21a06fb4257889f7541110f6017@BL2PR03MB145.namprd03.prod.outlook.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1400272625 30462 80.91.229.3 (16 May 2014 20:37:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 16 May 2014 20:37:05 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Stephan Mueller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 16 22:36:58 2014 Return-path: Envelope-to: ged-emacs-devel@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 1WlOsB-0001lO-EN for ged-emacs-devel@m.gmane.org; Fri, 16 May 2014 22:36:55 +0200 Original-Received: from localhost ([::1]:37723 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WlOsA-0005Fn-R6 for ged-emacs-devel@m.gmane.org; Fri, 16 May 2014 16:36:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43845) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WlOs3-0005Fd-Ty for emacs-devel@gnu.org; Fri, 16 May 2014 16:36:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WlOry-0000xP-Ny for emacs-devel@gnu.org; Fri, 16 May 2014 16:36:47 -0400 Original-Received: from mtaout28.012.net.il ([80.179.55.184]:37724) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WlOry-0000xI-FS for emacs-devel@gnu.org; Fri, 16 May 2014 16:36:42 -0400 Original-Received: from conversion-daemon.mtaout28.012.net.il by mtaout28.012.net.il (HyperSendmail v2007.08) id <0N5O00O00NY19N00@mtaout28.012.net.il> for emacs-devel@gnu.org; Fri, 16 May 2014 23:34:52 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout28.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N5O00KIGP63QY70@mtaout28.012.net.il>; Fri, 16 May 2014 23:34:52 +0300 (IDT) In-reply-to: <9711a21a06fb4257889f7541110f6017@BL2PR03MB145.namprd03.prod.outlook.com> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.184 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:171895 Archived-At: > From: Stephan Mueller > Date: Fri, 16 May 2014 18:08:18 +0000 > Cc: "monnier@iro.umontreal.ca" , > "emacs-devel@gnu.org" > > From: Eli Zaretskii [mailto:eliz@gnu.org] > " > From: Stephan Mueller > " > " > Long lines slow down redisplay because it needs to scan the entire > " > " > line to see how tall it will be on display. > " > " > " > " Why should it care about the whole line rather than only the part > " > " of it that's displayed? > " > > " > So that the line height doesn't change when scrolling horizontally > " > and a taller character comes into view? > " > " No, horizontal scrolling causes another redisplay, which examines the > " characters that came into view at that time. > > So, IIUC, that means that scrolling horizontally _can_ cause the user's > experience to be that the height of a line was changed by looking at a > different portion of it. Yes, it can happen. You can see this yourself like this: emacs -Q M-x font-lock-mode RET M-x load-library RET info RET C-u 122 M-x goto-char RET C-SPC C-e M-o O info-title-1 RET C-a C-x 3 C-e > Understood it is redisplayed (and so no doubt draws correctly), but > I'd still consider the height change to be an odd behaviour. I'm > curious if it was an intentional choice (perhaps in the name of > perf, removing one of the reasons to scan the whole line)? It is the design principle of the Emacs display engine to examine as little of buffer text as possible, because otherwise it would be unbearably slow, even on a fast machine.