From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jason Rumney Newsgroups: gmane.emacs.bugs Subject: bug#233: Analysis of redisplay performance on Windows Date: Fri, 25 Jul 2008 01:22:28 +0100 Message-ID: <48891CC4.4030508@gnu.org> Reply-To: Jason Rumney , 233@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1216946867 22009 80.91.229.12 (25 Jul 2008 00:47:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 25 Jul 2008 00:47:47 +0000 (UTC) To: 233@emacsbugs.donarmstrong.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 25 02:48:36 2008 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 1KMBTw-00050l-I6 for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Jul 2008 02:48:29 +0200 Original-Received: from localhost ([127.0.0.1]:40144 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KMBT1-0008E3-Rw for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Jul 2008 20:47:31 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KMBSw-0008Dm-L9 for bug-gnu-emacs@gnu.org; Thu, 24 Jul 2008 20:47:26 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KMBSv-0008Da-QE for bug-gnu-emacs@gnu.org; Thu, 24 Jul 2008 20:47:26 -0400 Original-Received: from [199.232.76.173] (port=56708 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KMBSv-0008DX-Kd for bug-gnu-emacs@gnu.org; Thu, 24 Jul 2008 20:47:25 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:46190) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KMBSu-0005NJ-AA for bug-gnu-emacs@gnu.org; Thu, 24 Jul 2008 20:47:25 -0400 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 m6P0lJl1005039; Thu, 24 Jul 2008 17:47:19 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m6P0U4ML000423; Thu, 24 Jul 2008 17:30:04 -0700 X-Loop: don@donarmstrong.com Resent-From: Jason Rumney Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 25 Jul 2008 00:30:04 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 233 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 233-submit@emacsbugs.donarmstrong.com id=B233.121694541431606 (code B ref 233); Fri, 25 Jul 2008 00:30:04 +0000 Original-Received: (at 233) by emacsbugs.donarmstrong.com; 25 Jul 2008 00:23:34 +0000 Original-Received: from mk-outboundfilter-5.mail.uk.tiscali.com (mk-outboundfilter-5.mail.uk.tiscali.com [212.74.114.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m6P0NTHG031600 for <233@emacsbugs.donarmstrong.com>; Thu, 24 Jul 2008 17:23:31 -0700 Original-X-Trace: 61617675/mk-outboundfilter-5.mail.uk.tiscali.com/F2S/$F2S-ACCEPTED/f2s-freedom2Surf-customers/83.67.23.108 X-SBRS: None X-RemoteIP: 83.67.23.108 X-IP-MAIL-FROM: jasonr@gnu.org X-IP-BHB: Once X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjcFABC5iEhTQxds/2dsb2JhbACBWrBm X-IronPort-AV: E=Sophos;i="4.31,249,1215385200"; d="scan'208";a="61617675" X-IP-Direction: IN Original-Received: from i-83-67-23-108.freedom2surf.net (HELO wanchan.jasonrumney.net) ([83.67.23.108]) by smtp.f2s.tiscali.co.uk with ESMTP; 25 Jul 2008 01:22:41 +0100 Original-Received: from [192.168.249.27] (chiko.jasonrumney.net [192.168.249.27]) by wanchan.jasonrumney.net (Postfix) with ESMTP id 2426A1B7 for <233@emacsbugs.donarmstrong.com>; Fri, 25 Jul 2008 01:22:56 +0100 (BST) User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) X-Enigmail-Version: 0.95.6 OpenPGP: id=8086879D X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Resent-Date: Thu, 24 Jul 2008 20:47:26 -0400 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:18840 Archived-At: The redisplay performance problems on Windows seem to be mostly caused by the left_overwriting and right_overwriting functions. These functions analyse all glyphs, one by one, before and after (respectively) the current glyph string on the same row to see if the glyphs overlap the current glyph string. To determine the overlap for each glyph, it is necessary to encode it into a glyph code point in the font used to display it, then measure its text extents. Even with caching of the text extents, the Windows code is still especially slow here because of the encoding to glyph code points. Currently we cache glyph code points at the glyph_string level. Perhaps caching them at the glyph row level would help, as we could then reuse them after we have finished with the glyph string. Alternatively we could keep all the glyph strings for the row until we are finished so we could use glyph code points and other information from there. This might reduce the number of iterations we need to find the left and right overwriting glyphs, since we can check the glyph strings for overlaps first, and only check the glyphs inside glyph strings that overlap. There may also be a problem with the setting of row->contains_overlapping_glyphs_p on Windows. The above functions should only be called when that is set, but after inserting debugging code I can see them being called frequently even when using fonts that contain no overlapping glyphs (confirmed by further debugging code in w32font_text_metrics).