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: ftx font driver [Re: Low redisplay performance (23 regression)] Date: Thu, 23 Apr 2009 16:31:44 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: <4870CC42-A08E-4BE9-B566-0F4DA7AB0B74@gmail.com> <873ac3arbf.fsf@cyd.mit.edu> <83r5zmhf2q.fsf@gnu.org> <83mya9hm0i.fsf@gnu.org> <873ac0aeoy.fsf@CPU107.opentrends.net> 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 1240471938 20021 80.91.229.12 (23 Apr 2009 07:32:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 23 Apr 2009 07:32:18 +0000 (UTC) Cc: dcl441-bugs@yahoo.com, emacs-devel@gnu.org To: Kenichi Handa Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 23 09:33:37 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 1LwtR7-0000LC-9S for ged-emacs-devel@m.gmane.org; Thu, 23 Apr 2009 09:33:33 +0200 Original-Received: from localhost ([127.0.0.1]:43598 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LwtPi-0003wt-2o for ged-emacs-devel@m.gmane.org; Thu, 23 Apr 2009 03:32:06 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LwtPc-0003wm-KN for emacs-devel@gnu.org; Thu, 23 Apr 2009 03:32:00 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LwtPX-0003u6-Sc for emacs-devel@gnu.org; Thu, 23 Apr 2009 03:32:00 -0400 Original-Received: from [199.232.76.173] (port=53295 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LwtPX-0003tz-OL for emacs-devel@gnu.org; Thu, 23 Apr 2009 03:31:55 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]:54304) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LwtPX-00035p-72 for emacs-devel@gnu.org; Thu, 23 Apr 2009 03:31:55 -0400 Original-Received: from ntp.math.s.chiba-u.ac.jp ([133.82.132.2] helo=mathmail.math.s.chiba-u.ac.jp) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LwtPV-0005AX-RS for emacs-devel@gnu.org; Thu, 23 Apr 2009 03:31:54 -0400 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 6CE192C44; Thu, 23 Apr 2009 16:31:46 +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-kernel: by mx20.gnu.org: NetBSD 3.0 (DF) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:110423 Archived-At: >>>>> On Thu, 23 Apr 2009 10:01:12 +0900, Kenichi Handa said: >>> I haven't compared Emacs 22 and 23, but from a subjective point of >>> view I have noticed that latest Emacs 23 feels slow and updates >>> too much for a modern computer. Some particular problems I noticed >>> randomly: >> Which font backend driver are you using? You can check it with >> (cdr (assq 'font-backend (frame-parameters))). I found the ftx >> font driver was much slower than the xft one partly because of >> repeated calculations of font metrics. (So I added some cache code >> to ftcrfont.c in my latest cairo patch posted here). > Please exlain why it calculates font metrics repeatedly. > As ftx font driver is not used by default on any platforms, it is > not tested well and I myself don't remember the code well. There might be the case that the Xft library is not installed, does not have a sufficient version, or not found by configure for some reasons (e.g., PKG_CONFIG_PATH is not set appropriately). In such cases, the ftx font driver is selected as a default. Of course, you can reproduce such a situation with --without-xft. The result of time profiling using Shark.app indicates that FT_Load_Glyph called from ftfont_text_extents takes much time and calculates font metrics repeatedly without caching. In particular, it's really slow if the font is actually in a gzipped PCF format. YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp 0.0% 99.7% emacs start 0.0% 99.7% emacs main 0.0% 99.7% emacs Frecursive_edit 0.0% 99.7% emacs recursive_edit_1 0.0% 99.7% emacs command_loop 0.0% 99.7% emacs internal_catch 0.0% 99.7% emacs command_loop_2 0.0% 99.7% emacs internal_condition_case 0.0% 99.7% emacs command_loop_1 0.0% 79.4% emacs call3 0.0% 79.4% emacs Ffuncall 0.0% 79.4% emacs Fcall_interactively 0.0% 79.4% emacs Ffuncall 0.0% 69.9% emacs Fscroll_down 0.0% 69.9% emacs scroll_command 0.0% 69.9% emacs window_scroll 0.0% 25.1% emacs pos_visible_p 0.0% 22.4% emacs move_it_to 0.0% 22.4% emacs move_it_in_display_line_to 0.0% 22.3% emacs x_produce_glyphs 0.0% 22.2% emacs get_per_char_metric 0.0% 22.2% emacs ftfont_text_extents 0.0% 22.2% libfreetype.6.dylib FT_Load_Glyph 0.1% 22.0% libfreetype.6.dylib PCF_Glyph_Load 0.0% 21.8% libfreetype.6.dylib FT_Stream_Seek 0.0% 21.8% libfreetype.6.dylib ft_gzip_stream_io 0.0% 21.8% libfreetype.6.dylib ft_gzip_file_io 0.0% 21.8% libfreetype.6.dylib ft_gzip_file_skip_output 21.3% 21.8% libfreetype.6.dylib ft_gzip_file_fill_output 0.5% 0.5% libfreetype.6.dylib ft_gzip_file_fill_input 0.0% 0.1% libfreetype.6.dylib ft_glyphslot_alloc_bitmap 0.0% 0.1% libfreetype.6.dylib FT_Stream_Read 0.0% 0.1% libfreetype.6.dylib ft_glyphslot_clear 0.0% 0.1% emacs get_char_face_and_encoding 0.0% 0.0% emacs get_it_property 0.0% 0.0% emacs get_next_display_element 0.0% 0.0% emacs set_iterator_to_next 0.0% 2.1% emacs display_mode_line 0.0% 0.7% emacs line_bottom_y 0.0% 22.5% emacs move_it_to 0.0% 22.5% emacs move_it_in_display_line_to 0.0% 22.4% emacs x_produce_glyphs 0.0% 22.3% emacs get_per_char_metric 0.0% 22.3% emacs ftfont_text_extents 0.0% 22.3% libfreetype.6.dylib FT_Load_Glyph 0.0% 22.2% libfreetype.6.dylib PCF_Glyph_Load 0.0% 22.0% libfreetype.6.dylib FT_Stream_Seek 0.0% 22.0% libfreetype.6.dylib ft_gzip_stream_io 0.0% 22.0% libfreetype.6.dylib ft_gzip_file_io 0.0% 21.9% libfreetype.6.dylib ft_gzip_file_skip_output 21.5% 21.9% libfreetype.6.dylib ft_gzip_file_fill_output 0.0% 0.0% libfreetype.6.dylib ft_gzip_file_reset 0.0% 0.1% libfreetype.6.dylib FT_Stream_Read 0.0% 0.1% libfreetype.6.dylib ft_glyphslot_alloc_bitmap 0.0% 0.0% libfreetype.6.dylib ft_synthesize_vertical_metrics 0.0% 0.1% libfreetype.6.dylib ft_glyphslot_clear 0.0% 0.1% emacs get_char_face_and_encoding 0.0% 0.0% emacs get_it_property 0.0% 0.1% emacs get_next_display_element 0.0% 0.0% emacs set_iterator_to_next 0.0% 0.0% emacs recenter_overlay_lists 0.0% 21.7% emacs move_it_vertically_backward 0.0% 0.6% emacs move_it_by_lines 0.0% 9.5% emacs Fscroll_up 0.0% 20.3% emacs read_key_sequence 0.0% 0.0% emacs resize_echo_area_exactly 0.0% 0.0% emacs start_hourglass 0.0% 0.0% emacs safe_run_hooks 0.0% 0.0% emacs Fcommand_remapping 0.1% 0.1% mach_kernel lo_alltraps 0.0% 0.1% mach_kernel lo_mach_scall 0.0% 0.0% mach_kernel lo_unix_scall 0.0% 0.0% mach_kernel i386_astintr 0.0% 0.0% mach_kernel IOWorkLoop::threadMain() 0.0% 0.0% mach_kernel thread_call_enter_delayed 0.0% 0.0% mach_kernel uiomove