From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.devel Subject: Re: reducing equality tests in displaying text Date: Thu, 29 Jan 2009 10:46:22 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1233193602 21718 80.91.229.12 (29 Jan 2009 01:46:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 29 Jan 2009 01:46:42 +0000 (UTC) Cc: emacs-devel@gnu.org To: Kenichi Handa Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 29 02:47: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 1LSM0Z-0001s9-3E for ged-emacs-devel@m.gmane.org; Thu, 29 Jan 2009 02:47:55 +0100 Original-Received: from localhost ([127.0.0.1]:52334 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LSLzG-0001Vt-RQ for ged-emacs-devel@m.gmane.org; Wed, 28 Jan 2009 20:46:34 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LSLzB-0001SX-E4 for emacs-devel@gnu.org; Wed, 28 Jan 2009 20:46:29 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LSLzA-0001S6-Tg for emacs-devel@gnu.org; Wed, 28 Jan 2009 20:46:29 -0500 Original-Received: from [199.232.76.173] (port=37163 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LSLzA-0001S0-QX for emacs-devel@gnu.org; Wed, 28 Jan 2009 20:46:28 -0500 Original-Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:49251) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LSLz9-0007wk-Vu for emacs-devel@gnu.org; Wed, 28 Jan 2009 20:46:28 -0500 Original-Received: from church.math.s.chiba-u.ac.jp (church [133.82.132.36]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 2131F2C5A; Thu, 29 Jan 2009 10:46:25 +0900 (JST) In-Reply-To: User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) X-detected-operating-system: by monty-python.gnu.org: NetBSD 3.0 (DF) 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:108345 Archived-At: >>>>> On Thu, 29 Jan 2009 09:37:19 +0900, Kenichi Handa said: > Ummm, this result is surprising, but I found a bug in > fontset_get_font_group that is the culprit of so many calls of > char_table_ref_and_range. I simply forgot to record the result of > previous call in the case of nil. I should have noticed it when you > wrote that from and to were never used in such a case. :-( > Anyway, please try the new code. I think that the calls of > char_rable_ref itself is reduced. Yes, it gives a good result. Thanks. 675.1 ms emacs mark_object 164.5 ms libfreetype.6.dylib tt_cmap4_char_map_binary 133.0 ms emacs mark_vectorlike 117.6 ms emacs Fgarbage_collect 41.5 ms emacs x_produce_glyphs 41.4 ms emacs char_table_ref 33.3 ms emacs fontset_find_font 32.3 ms emacs get_next_display_element 29.5 ms emacs display_count_lines 29.3 ms emacs assq_no_quit 28.3 ms emacs face_for_char 24.3 ms mach_kernel ml_set_interrupts_enabled 24.3 ms libXft.2.dylib XftCharIndex 24.3 ms emacs append_glyph 24.3 ms libXft.2.dylib XftGlyphExtents 24.2 ms emacs hash_lookup 23.2 ms emacs sub_char_table_ref 22.3 ms emacs find_interval 22.2 ms emacs Fcons 22.2 ms emacs sort_overlays >> Is there any reason you prefer an Xft-level routine to >> fontconfig-level? By adding some `FcCharSet *' member in struct >> ftfont as I said, you don't need to "override" `has_char' function >> in the xft driver, and the ftx driver can also benefit from it for >> free. > In ftfont.c, fontconfig is used only to list fonts. The other > actual font driving is done directly by freetype. Currently, the > exception is ftfont_has_char, but I want to find a way to avoid > using fontconfig here too. > The reason why I want to keep this separation is that listing fonts > and using a font is different tasks, and, in the future, I want to > allow different combinations of them. I don't think it's unnatural for font listing layers to provide `has_char' functionality, because that layer already involves supported charset inclusion test in its core part. > On the other hand, as Xft is so tightly combined with fontconfig, > and it already has `charset' member in XftFont structure, it is > nonsense not to utilize it. Of course, it makes sense for font driving layers to provide alternative implementations of `has_char', if it is more efficient than the underlying counterpart in the font listing layer. Another (maybe cleaner) design would be to separate the current `has_char' function into that for font entities (font listing layer) and that for font objects (font driving layer). YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp