From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: 23/NS: redraws according to mouse-face are slow Date: Mon, 04 May 2009 21:53:10 -0400 Message-ID: <87d4aowc1l.fsf@cyd.mit.edu> References: <4383E9F6-9B66-4DA4-AA3C-D602EB059B97@gmail.com> <139B721E-A1B4-4256-B202-D4472C0331FB@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1241488406 15113 80.91.229.12 (5 May 2009 01:53:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 May 2009 01:53:26 +0000 (UTC) Cc: 2530@emacsbugs.donarmstrong.com, Ian Eure , Adrian Robert , Emacs-Devel devel To: David Reitter Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 05 03:53:17 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 1M19qO-0004AH-FX for ged-emacs-devel@m.gmane.org; Tue, 05 May 2009 03:53:17 +0200 Original-Received: from localhost ([127.0.0.1]:53035 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M19qN-0003bz-UT for ged-emacs-devel@m.gmane.org; Mon, 04 May 2009 21:53:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M19qG-0003ZK-40 for emacs-devel@gnu.org; Mon, 04 May 2009 21:53:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M19qB-0003WX-9G for emacs-devel@gnu.org; Mon, 04 May 2009 21:53:07 -0400 Original-Received: from [199.232.76.173] (port=34200 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M19qB-0003WO-4h for emacs-devel@gnu.org; Mon, 04 May 2009 21:53:03 -0400 Original-Received: from cyd.mit.edu ([18.115.2.24]:49226) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M19qA-0007LS-Rc for emacs-devel@gnu.org; Mon, 04 May 2009 21:53:02 -0400 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: 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:110662 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?