From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jason Rumney Newsgroups: gmane.emacs.devel Subject: Re: Analysis of redisplay performance on Windows Date: Sun, 27 Jul 2008 10:55:11 +0100 Message-ID: <488C45FF.2040509@gnu.org> References: <87od4kuis1.fsf@stupidchicken.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 1217152581 6795 80.91.229.12 (27 Jul 2008 09:56:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 27 Jul 2008 09:56:21 +0000 (UTC) Cc: emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 27 11:57:11 2008 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 1KN302-000473-JN for ged-emacs-devel@m.gmane.org; Sun, 27 Jul 2008 11:57:10 +0200 Original-Received: from localhost ([127.0.0.1]:49975 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KN2z8-0004w7-NP for ged-emacs-devel@m.gmane.org; Sun, 27 Jul 2008 05:56:14 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KN2yR-0004Zf-G3 for emacs-devel@gnu.org; Sun, 27 Jul 2008 05:55:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KN2yP-0004Yr-Fz for emacs-devel@gnu.org; Sun, 27 Jul 2008 05:55:30 -0400 Original-Received: from [199.232.76.173] (port=44720 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KN2yO-0004Yi-QU for emacs-devel@gnu.org; Sun, 27 Jul 2008 05:55:29 -0400 Original-Received: from mk-outboundfilter-3.mail.uk.tiscali.com ([212.74.114.23]:19770) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KN2yO-0004Zg-Dy for emacs-devel@gnu.org; Sun, 27 Jul 2008 05:55:28 -0400 Original-X-Trace: 149712085/mk-outboundfilter-1.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: AvgEANPii0hTQxds/2dsb2JhbACBW4k+oiY X-IronPort-AV: E=Sophos;i="4.31,259,1215385200"; d="scan'208";a="149712085" 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; 27 Jul 2008 10:55:27 +0100 Original-Received: from [192.168.249.27] (chiko.jasonrumney.net [192.168.249.27]) by wanchan.jasonrumney.net (Postfix) with ESMTP id 3006B1B7; Sun, 27 Jul 2008 10:55:49 +0100 (BST) User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) In-Reply-To: <87od4kuis1.fsf@stupidchicken.com> X-Enigmail-Version: 0.95.6 OpenPGP: id=8086879D X-detected-kernel: 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:101575 Archived-At: Chong Yidong wrote: >> 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). > > But I don't understand why the problem of left_overwriting and > right_overwriting, if that's indeed the culprit, would be specific to > Windows. That is why I suspect there may be a problem with the setting of row->contains_overlapping_glyphs_p on Windows. We avoid calling those functions if that variable is not set. It may also be much more expensive to look up the glyph index points in Windows, that is the case for obtaining text extents, so it wouldn't surprise me. Another factor is that we do this all one character at a time, and each time on Windows we select the font into the current GC, then reselect the previously set font. This operation is also expensive, so it would help to have functions in the font backend interface for selecting and deselecting fonts. I already tried using prepare_face and done_face for this, but the calls overlap - ie we prepare a second face without calling done_face for the first.