From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: Low redisplay performance (23 regression) Date: Wed, 29 Apr 2009 23:49:43 -0400 Message-ID: <87ljpi4x7s.fsf@cyd.mit.edu> References: <4870CC42-A08E-4BE9-B566-0F4DA7AB0B74@gmail.com> <878wlj228q.fsf@freebits.de> <87r5zb4auv.fsf@thinkpad.tsdh.de> <24EC426D-D6DA-438B-B794-72C123142235@gmail.com> <87zldzcn8q.fsf@cyd.mit.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1241063406 17664 80.91.229.12 (30 Apr 2009 03:50:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 30 Apr 2009 03:50:06 +0000 (UTC) Cc: David Reitter , Tassilo Horn , Miles Bader , emacs-devel@gnu.org To: YAMAMOTO Mitsuharu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 30 05:49:56 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 1LzNHU-0002Z8-P5 for ged-emacs-devel@m.gmane.org; Thu, 30 Apr 2009 05:49:53 +0200 Original-Received: from localhost ([127.0.0.1]:36170 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LzNHU-0001Vp-6l for ged-emacs-devel@m.gmane.org; Wed, 29 Apr 2009 23:49:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LzNHN-0001TZ-RJ for emacs-devel@gnu.org; Wed, 29 Apr 2009 23:49:45 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LzNHJ-0001QO-DK for emacs-devel@gnu.org; Wed, 29 Apr 2009 23:49:45 -0400 Original-Received: from [199.232.76.173] (port=38492 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LzNHJ-0001QB-5L for emacs-devel@gnu.org; Wed, 29 Apr 2009 23:49:41 -0400 Original-Received: from cyd.mit.edu ([18.115.2.24]:52273) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LzNHH-0005GX-JS; Wed, 29 Apr 2009 23:49:39 -0400 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id 1D9E357E205; Wed, 29 Apr 2009 23:49:43 -0400 (EDT) In-Reply-To: (YAMAMOTO Mitsuharu's message of "Thu, 30 Apr 2009 11:46:16 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (gnu/linux) 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:110566 Archived-At: YAMAMOTO Mitsuharu writes: >> I think the problem is that lookup_basic_face computes the remapped >> face_id in an expensive way. It needs to do some caching. > > Some profiling results show that many Lisp objects are constructed in > font_clear_prop, and that causes frequent GC triggered by Lisp > evaluations in redisplay such as mode/header-line calculation. That > would also explain why the OP doesn't observe the slowness on Emacs 22 > with backported face remapping. That's surprising. I have experimented with making font_clear_prop overwrite font specs instead of allocating new ones, when possible. However, this does not seem to improve performance (I do not intend to change this for 23.1). I think the fundamental problem does not lie in font_clear_prop, but in the fact that the face remapping code's lookup_basic_face function calls lookup_named_face -> merge_face_vectors far too often.