From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Jan_Dj=E4rv?= Newsgroups: gmane.emacs.devel Subject: Re: Display performance degradation Date: Fri, 18 Dec 2009 17:47:22 +0100 Message-ID: <4B2BB21A.8050709@swipnet.se> References: <4B29E046.8050107@swipnet.se> <838wd1749d.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1261154870 17023 80.91.229.12 (18 Dec 2009 16:47:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 18 Dec 2009 16:47:50 +0000 (UTC) Cc: mituharu@math.s.chiba-u.ac.jp, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 18 17:47:42 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NLfzS-0005c4-3d for ged-emacs-devel@m.gmane.org; Fri, 18 Dec 2009 17:47:42 +0100 Original-Received: from localhost ([127.0.0.1]:54094 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NLfzS-0005zK-35 for ged-emacs-devel@m.gmane.org; Fri, 18 Dec 2009 11:47:42 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NLfzL-0005wv-LN for emacs-devel@gnu.org; Fri, 18 Dec 2009 11:47:35 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NLfzG-0005rl-BA for emacs-devel@gnu.org; Fri, 18 Dec 2009 11:47:34 -0500 Original-Received: from [199.232.76.173] (port=42435 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NLfzG-0005rd-7H for emacs-devel@gnu.org; Fri, 18 Dec 2009 11:47:30 -0500 Original-Received: from proxy2.bredband.net ([195.54.101.72]:57301) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NLfzC-0005zB-HA; Fri, 18 Dec 2009 11:47:26 -0500 Original-Received: from ipb1.telenor.se (195.54.127.164) by proxy2.bredband.net (7.3.140.3) id 4AD3E1BC01D4D45A; Fri, 18 Dec 2009 17:47:23 +0100 X-SMTPAUTH-B2: X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmdTAJZAK0tV4S1uPGdsb2JhbACBSocgkA+CSAEBAQE3uUSCOYF1BI0k X-IronPort-AV: E=Sophos;i="4.47,418,1257116400"; d="scan'208";a="17397050" Original-Received: from c-6e2de155.25-1-64736c10.cust.bredbandsbolaget.se (HELO coolsville.localdomain) ([85.225.45.110]) by ipb1.telenor.se with ESMTP; 18 Dec 2009 17:47:23 +0100 Original-Received: from [172.20.199.2] (gaffa [172.20.199.2]) by coolsville.localdomain (Postfix) with ESMTP id E34367FA07B; Fri, 18 Dec 2009 17:47:22 +0100 (CET) User-Agent: Thunderbird 2.0.0.23 (X11/20090817) In-Reply-To: <838wd1749d.fsf@gnu.org> X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:118718 Archived-At: Eli Zaretskii skrev: >> Date: Thu, 17 Dec 2009 08:39:50 +0100 >> From: "Jan D." >> Cc: emacs-devel@gnu.org >> >> The core problem is that Emacs internally doesn't track >> what is changed. So it re-evaluates faces, fonts, menus, toolbars and >> so on, all the time before redisplay, and 99.99% of those times, nothing >> has changed. > > Unless you are talking specifically about fonts (where I'm almost > totally ignorant), the above is not really true. The redisplay code > includes quite a few shortcuts that try to reuse large parts of > existing display, instead of redrawing it. > Sure, but for each redisplay there is a lot of updating of other stuff, that really doesn't need updating, like toll bars, menus and faces. >> Emacs should to things all the way to get rid of this problem. Now, >> when a menu for exampls is changed in lisp, the actual widgets on the >> screen are not changed until later. So there is no connection between >> the change and the update on the screen. So Emacs re-evaluates menus a >> lot of times just to be sure, in case something changed at the lisp >> level. Instead the lisp change should lead to a screen change at once. > > I'm far from being an expert on this, but AFAIU, what you want is > impossible without a total redesign of one of the main features of > Emacs architecture: that Lisp code changes only the buffer text and > various attributes of buffer text, while redisplay happens > independently of that, when Emacs decides that ``it's a good time'' to > do that. > Redisplay is one thing, I'm not talking about that. Rader the realization and merging of faces that happens when redisplay is to be done. >> That way we know that the menu is up to date and we don't have to >> re-evaluate it. > > I think re-evaluation of menus is unrelated to redisplay. Sure, but not to preformance. > >> The same is true for faces, which I assume causes this problem. > > Faces are not recomputed unless necessary. Large portions of the > display engine try very hard to avoid recomputing faces as much as > possible, to the degree that sometimes you need to work very hard even > to see the code which recomputes faces in action, because the various > optimizations completely short-circuit it. Hmm, faces are recomputed all the time. If I start emacs like so: % ./emacs -Q ../etc/tutorials/TUTORIAL.ja Emacs does 102 calls to merge_face_vectors. This may be needed, I haven't looked at this in detail. What is strange though, is that if I scroll to the bottom of the buffer, another 62 calls to merge_face_vectors are done even if no face has changed. Jan D.