From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.bugs Subject: bug#1990: 23.0.60; Emacs trying too hard to find fonts that don't exist Date: Mon, 26 Jan 2009 17:00:09 +0900 Message-ID: References: <87sknaaa0m.fsf@cyd.mit.edu> <4979CD93.5040503@gnu.org> <87d4ec1o6z.fsf@cyd.mit.edu> Reply-To: Kenichi Handa , 1990@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1233001306 9927 80.91.229.12 (26 Jan 2009 20:21:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 26 Jan 2009 20:21:46 +0000 (UTC) Cc: 1990@emacsbugs.donarmstrong.com To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jan 26 21:22:59 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LRXxz-0005Xr-W4 for geb-bug-gnu-emacs@m.gmane.org; Mon, 26 Jan 2009 21:21:56 +0100 Original-Received: from localhost ([127.0.0.1]:34937 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LRXwi-0003xE-3K for geb-bug-gnu-emacs@m.gmane.org; Mon, 26 Jan 2009 15:20:36 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LRWZg-0002FC-KL for bug-gnu-emacs@gnu.org; Mon, 26 Jan 2009 13:52:44 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LRWZf-0002EE-MO for bug-gnu-emacs@gnu.org; Mon, 26 Jan 2009 13:52:44 -0500 Original-Received: from [199.232.76.173] (port=42467 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LRWZf-0002E0-EN for bug-gnu-emacs@gnu.org; Mon, 26 Jan 2009 13:52:43 -0500 Original-Received: from mx20.gnu.org ([199.232.41.8]:52572) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LRVJs-00077x-JW for bug-gnu-emacs@gnu.org; Mon, 26 Jan 2009 12:32:21 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LRMpa-0001k8-ET for bug-gnu-emacs@gnu.org; Mon, 26 Jan 2009 03:28:30 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n0Q8NTDC027563; Mon, 26 Jan 2009 00:23:29 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n0Q8A4qq024060; Mon, 26 Jan 2009 00:10:04 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Kenichi Handa Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Mon, 26 Jan 2009 08:10:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 1990 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 1990-submit@emacsbugs.donarmstrong.com id=B1990.123295681621444 (code B ref 1990); Mon, 26 Jan 2009 08:10:04 +0000 Original-Received: (at 1990) by emacsbugs.donarmstrong.com; 26 Jan 2009 08:00:16 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from mx1.aist.go.jp (mx1.aist.go.jp [150.29.246.133]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n0Q80754021037 for <1990@emacsbugs.donarmstrong.com>; Mon, 26 Jan 2009 00:00:09 -0800 Original-Received: from rqsmtp1.aist.go.jp (rqsmtp1.aist.go.jp [150.29.254.115]) by mx1.aist.go.jp with ESMTP id n0Q805mJ013409; Mon, 26 Jan 2009 17:00:05 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp3.aist.go.jp by rqsmtp1.aist.go.jp with ESMTP id n0Q805J2027934; Mon, 26 Jan 2009 17:00:05 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp3.aist.go.jp with ESMTP id n0Q804x5025766; Mon, 26 Jan 2009 17:00:04 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken with local (Exim 4.69) (envelope-from ) id 1LRMO9-0004Wg-Cc; Mon, 26 Jan 2009 17:00:09 +0900 In-reply-to: <87d4ec1o6z.fsf@cyd.mit.edu> (message from Chong Yidong on Sat, 24 Jan 2009 14:47:16 -0500) X-detected-kernel: by mx20.gnu.org: Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Resent-Date: Mon, 26 Jan 2009 13:52:44 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:24570 Archived-At: In article <87d4ec1o6z.fsf@cyd.mit.edu>, Chong Yidong writes: > Jason Rumney writes: >>> However, there are several other places in that function that return >>> with a Qnil, without doing this FONTSET_SET. Do matters improve if >>> we do the same FONTSET_SET call before returning? > > > > It doesn't seem to help much, if at all. > How about something like this? Does it improve performance noticeably? > *** trunk/src/fontset.c.~1.150.~ 2009-01-08 06:46:23.000000000 -0500 > --- trunk/src/fontset.c 2009-01-24 14:44:09.000000000 -0500 > *************** > *** 660,665 **** > --- 660,668 ---- > Lisp_Object rfont_def; > Lisp_Object base_fontset; > + if (EQ (Fchar_table_range (fontset, make_number (c)), Qt)) > + return Qnil; > + > /* Try a font-group of FONTSET. */ > rfont_def = fontset_find_font (fontset, c, face, id, 0); > if (VECTORP (rfont_def)) I found a bug in fontset_find_font in handling non-cons return value of fontset_get_font_group (it seems that I embugged it when I modified fontset.c largely last time). Your change surely fixes the bug, but it does unnecessary char-table lookup for the normal case (i.e. a font is found). So, I think the following patch is better. If you agree, please install it. I, at the moment, can't do cvs commit. 2009-01-26 Kenichi Handa * fontset.c (fontset_find_font): Fix handling of non-cons return value of fontset_get_font_group. (fontset_font): Cancel previous change. *** fontset.c.~1.151.~ 2009-01-26 16:52:57.000000000 +0900 --- fontset.c 2009-01-26 16:53:14.000000000 +0900 *************** *** 521,527 **** font_group = fontset_get_font_group (fontset, fallback ? -1 : c); if (! CONSP (font_group)) ! return Qnil; vec = XCDR (font_group); if (ASIZE (vec) == 0) return Qnil; --- 521,527 ---- font_group = fontset_get_font_group (fontset, fallback ? -1 : c); if (! CONSP (font_group)) ! return font_group; vec = XCDR (font_group); if (ASIZE (vec) == 0) return Qnil; *************** *** 660,669 **** Lisp_Object rfont_def; Lisp_Object base_fontset; - /* If we know there is no font of C, don't do any work. */ - if (EQ (fontset_ref (fontset, c), Qt)) - return Qnil; - /* Try a font-group of FONTSET. */ rfont_def = fontset_find_font (fontset, c, face, id, 0); if (VECTORP (rfont_def)) --- 660,665 ---- --- Kenichi Handa handa@m17n.org