From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.bugs Subject: bug#2530: 23/NS: redraws according to mouse-face are slow Date: Mon, 04 May 2009 21:53:10 -0400 Message-ID: <87d4aowc1l.fsf__40906.1674298302$1241489557$gmane$org@cyd.mit.edu> References: <4383E9F6-9B66-4DA4-AA3C-D602EB059B97@gmail.com> <139B721E-A1B4-4256-B202-D4472C0331FB@gmail.com> Reply-To: Chong Yidong , 2530@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1241489557 17285 80.91.229.12 (5 May 2009 02:12:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 May 2009 02:12:37 +0000 (UTC) Cc: 2530@emacsbugs.donarmstrong.com, Ian Eure , Adrian Robert , Emacs-Devel devel To: David Reitter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 05 04:12:27 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 1M1A8x-0000mx-5z for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 May 2009 04:12:27 +0200 Original-Received: from localhost ([127.0.0.1]:45677 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M1A8w-0004VD-JI for geb-bug-gnu-emacs@m.gmane.org; Mon, 04 May 2009 22:12:26 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M1A8Y-0004GA-F0 for bug-gnu-emacs@gnu.org; Mon, 04 May 2009 22:12:02 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M1A8T-0004FJ-9F for bug-gnu-emacs@gnu.org; Mon, 04 May 2009 22:12:01 -0400 Original-Received: from [199.232.76.173] (port=47187 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M1A8T-0004F6-2L for bug-gnu-emacs@gnu.org; Mon, 04 May 2009 22:11:57 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:51943) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M1A8S-0002qB-FR for bug-gnu-emacs@gnu.org; Mon, 04 May 2009 22:11:56 -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 n452BrN1029030; Mon, 4 May 2009 19:11:54 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n452046c024368; Mon, 4 May 2009 19:00:04 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Chong Yidong Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs , owner@emacsbugs.donarmstrong.com Resent-Date: Tue, 05 May 2009 02:00:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 2530 X-Emacs-PR-Package: emacs,ns X-Emacs-PR-Keywords: Original-Received: via spool by 2530-submit@emacsbugs.donarmstrong.com id=B2530.124148838722906 (code B ref 2530); Tue, 05 May 2009 02:00:04 +0000 Original-Received: (at 2530) by emacsbugs.donarmstrong.com; 5 May 2009 01:53:07 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n451r2oT022892 for <2530@emacsbugs.donarmstrong.com>; Mon, 4 May 2009 18:53:04 -0700 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id 2535757E25E; Mon, 4 May 2009 21:53:10 -0400 (EDT) In-Reply-To: (David Reitter's message of "Mon, 4 May 2009 18:55:09 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Mon, 04 May 2009 22:12:01 -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:27701 Archived-At: Thanks for debugging this. > Now, in NS (or at least in Cocoa), there seem to be screen updates > every time we draw a glyph string. I see. It seems ns_draw_glyph_string is a lot more expensive that x_draw_glyph_string. The show_mouse_face function assumes that the *_draw_glyph_string operation is relatively cheap, which is why it's called inside a loop. My guess is that the problem lies in the calls to ns_focus and ns_unfocus in ns_draw_glyph_string. > If we wrap the code in show_mouse_face in NS[Dis|En]ableScreen, the > problem goes away for me (and it's not just delayed). Same for the > header-line/overlay issues I reported in #2530. If possible, we should minimize the amount of platform-dependent code inside xdisp.c. Could you experiment with putting these calls somewhere in nsterm.m, say surrounding the calls to note_mouse_highlight? Also, could it be ns_update_begin and ns_update_end that you want to call, instead of NSDisableScreen and NSEnableScreen?