From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Adrian Robert Newsgroups: gmane.emacs.devel Subject: Re: Serious performance problem with process output on Mac OSX Date: Tue, 30 Mar 2010 00:58:33 +0300 Message-ID: References: <83634jglab.fsf@gnu.org> <831vf7ge57.fsf@gnu.org> <83y6hfeyzw.fsf@gnu.org> <83vdcig87f.fsf@gnu.org> <87k4sywpvv.fsf@stupidchicken.com> <83tys2fbxs.fsf@gnu.org> <87hbo1iubm.fsf@home.jasonrumney.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: multipart/mixed; boundary=Apple-Mail-1--465062355 X-Trace: dough.gmane.org 1269900089 16688 80.91.229.12 (29 Mar 2010 22:01:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 29 Mar 2010 22:01:29 +0000 (UTC) To: Christian Lynbech , Emacs-Devel devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 30 00:01:25 2010 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.69) (envelope-from ) id 1NwN1Q-0006sK-10 for ged-emacs-devel@m.gmane.org; Tue, 30 Mar 2010 00:01:24 +0200 Original-Received: from localhost ([127.0.0.1]:53515 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NwN1P-0006nq-A0 for ged-emacs-devel@m.gmane.org; Mon, 29 Mar 2010 18:01:23 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NwMyv-00043a-Hd for emacs-devel@gnu.org; Mon, 29 Mar 2010 17:58:49 -0400 Original-Received: from [140.186.70.92] (port=50717 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NwMyq-0003zR-V3 for emacs-devel@gnu.org; Mon, 29 Mar 2010 17:58:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NwMyo-00064f-P3 for emacs-devel@gnu.org; Mon, 29 Mar 2010 17:58:44 -0400 Original-Received: from mail-ew0-f218.google.com ([209.85.219.218]:48301) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NwMyo-00063H-Bi for emacs-devel@gnu.org; Mon, 29 Mar 2010 17:58:42 -0400 Original-Received: by ewy10 with SMTP id 10so449613ewy.32 for ; Mon, 29 Mar 2010 14:58:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:mime-version :content-type:subject:date:in-reply-to:to:references:message-id :x-mailer; bh=BNt8ETYms+KPIO5tw73wAW0VCHjZro4yC8+q4RZcjew=; b=J1/tXQ1za8BEPeW/1fY99n+7NiyGd2H78m07GgRdjjOYbcnrQiihesK6neRmr2yKHC 5RsN2W5RjHN+GEyzNM4zYLbEq/yl+SCavbbZkFMSYjme53sPoi+Sg4mY4AeRYTkhFkun kSr+L0ffh9V+3UEJgTQYBLNjxk6RDZ+iPR2ow= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:mime-version:content-type:subject:date:in-reply-to:to :references:message-id:x-mailer; b=EKOCKKpGCB3ExtMGOQjPfLD+gBeLxlLwn0tYcrs0R3eHoduvc+/YEtEzNbafULUNt7 xDIceKOLhT8ZaBFuWf5kg2cNpCvBOwR3O2Su0PGcUDcKR87OHTEPcTY9amMaQSwkguWp WiBoVNV9H0jhDrYV/WqZx7GmbTiL1eIPlE2xA= Original-Received: by 10.213.54.194 with SMTP id r2mr686013ebg.92.1269899917734; Mon, 29 Mar 2010 14:58:37 -0700 (PDT) Original-Received: from [10.0.1.2] (dsl-hkibrasgw2-ff6ec300-110.dhcp.inet.fi [88.195.110.110]) by mx.google.com with ESMTPS id 13sm2570042ewy.9.2010.03.29.14.58.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 29 Mar 2010 14:58:36 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.1077) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:122882 Archived-At: --Apple-Mail-1--465062355 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Mar 28, 2010, at 5:41 PM, Adrian Robert wrote: > I suspect unneeded calls to one of the icon/icon_type methods in = nsfns.m or the miniwindowimage methods in nsterm.m are causing this. = Someone could try shortcircuiting these in the source and seeing if the = problem still obtains. I went ahead and tried this. The culprit was an unneeded = ns_set_icon_type() call. The attached patch cleans this up by removing = some HAVE_NS special handling in xdisp.c. --Apple-Mail-1--465062355 Content-Disposition: attachment; filename=dock_overflow_20100329.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="dock_overflow_20100329.patch" Content-Transfer-Encoding: 7bit Index: nsfns.m =================================================================== RCS file: /sources/emacs/emacs/src/nsfns.m,v retrieving revision 1.55 diff -u -p -r1.55 nsfns.m --- nsfns.m 24 Oct 2009 18:58:51 -0000 1.55 +++ nsfns.m 29 Mar 2010 21:56:36 -0000 @@ -80,6 +80,7 @@ extern Lisp_Object Qface_set_after_frame extern Lisp_Object Qunderline, Qundefined; extern Lisp_Object Qheight, Qminibuffer, Qname, Qonly, Qwidth; extern Lisp_Object Qunsplittable, Qmenu_bar_lines, Qbuffer_predicate, Qtitle; +extern Lisp_Object Vframe_title_format; Lisp_Object Qnone; Lisp_Object Qbuffered; @@ -586,7 +587,12 @@ x_implicitly_set_name (FRAME_PTR f, Lisp if (FRAME_ICONIFIED_P (f)) ns_set_name_iconic (f, arg, 0); else - ns_set_name (f, arg, 0); + { + if (FRAME_NS_P (f) && EQ (Vframe_title_format, Qt)) + ns_set_name_as_filename (f); + else + ns_set_name (f, arg, 0); + } } @@ -685,15 +691,18 @@ ns_set_name_as_filename (struct frame *f void -ns_set_doc_edited (struct frame *f, Lisp_Object arg, Lisp_Object oldval) +ns_set_doc_edited (struct frame *f, Lisp_Object arg) { NSView *view = FRAME_NS_VIEW (f); NSAutoreleasePool *pool; - BLOCK_INPUT; - pool = [[NSAutoreleasePool alloc] init]; - [[view window] setDocumentEdited: !NILP (arg)]; - [pool release]; - UNBLOCK_INPUT; + + if (!MINI_WINDOW_P (XWINDOW(f->selected_window))) { + BLOCK_INPUT; + pool = [[NSAutoreleasePool alloc] init]; + [[view window] setDocumentEdited: !NILP (arg)]; + [pool release]; + UNBLOCK_INPUT; + } } Index: nsterm.h =================================================================== RCS file: /sources/emacs/emacs/src/nsterm.h,v retrieving revision 1.29 diff -u -p -r1.29 nsterm.h --- nsterm.h 16 Oct 2009 03:09:06 -0000 1.29 +++ nsterm.h 29 Mar 2010 21:56:36 -0000 @@ -708,6 +708,8 @@ extern void nxatoms_of_nsselect (); extern int ns_lisp_to_cursor_type (); extern Lisp_Object ns_cursor_type_to_lisp (int arg); extern Lisp_Object Qnone; +extern void ns_set_name_as_filename (struct frame *f); +extern void ns_set_doc_edited (struct frame *f, Lisp_Object arg); extern int ns_defined_color (struct frame *f, char *name, XColor *color_def, int alloc, Index: nsterm.m =================================================================== RCS file: /sources/emacs/emacs/src/nsterm.m,v retrieving revision 1.95 diff -u -p -r1.95 nsterm.m --- nsterm.m 19 Oct 2009 16:58:20 -0000 1.95 +++ nsterm.m 29 Mar 2010 21:56:36 -0000 @@ -4191,7 +4191,6 @@ ns_term_shutdown (int sig) ns_send_appdefined (-2); } -extern void update_window_cursor (struct window *w, int on); - (void)fd_handler: (NSTimer *) fdEntry /* -------------------------------------------------------------------------- Index: xdisp.c =================================================================== RCS file: /sources/emacs/emacs/src/xdisp.c,v retrieving revision 1.1328 diff -u -p -r1.1328 xdisp.c --- xdisp.c 15 Dec 2009 22:53:39 -0000 1.1328 +++ xdisp.c 29 Mar 2010 21:56:38 -0000 @@ -9494,31 +9494,8 @@ x_consider_frame_title (frame) || SBYTES (f->name) != len || bcmp (title, SDATA (f->name), len) != 0) { -#ifdef HAVE_NS - if (FRAME_NS_P (f)) - { - if (!MINI_WINDOW_P(XWINDOW(f->selected_window))) - { - if (EQ (fmt, Qt)) - ns_set_name_as_filename (f); - else - x_implicitly_set_name (f, make_string(title, len), - Qnil); - } - } - else -#endif x_implicitly_set_name (f, make_string (title, len), Qnil); } -#ifdef HAVE_NS - if (FRAME_NS_P (f)) - { - /* do this also for frames with explicit names */ - ns_implicitly_set_icon_type(f); - ns_set_doc_edited(f, Fbuffer_modified_p - (XWINDOW (f->selected_window)->buffer), Qnil); - } -#endif } } @@ -9615,6 +9592,11 @@ prepare_menu_bars () #ifdef HAVE_WINDOW_SYSTEM update_tool_bar (f, 0); #endif +#ifdef HAVE_NS + if (windows_or_buffers_changed) + ns_set_doc_edited (f, Fbuffer_modified_p + (XWINDOW (f->selected_window)->buffer)); +#endif UNGCPRO; } @@ -22669,9 +22653,6 @@ display_and_set_cursor (w, on, hpos, vpo /* Switch the display of W's cursor on or off, according to the value of ON. */ -#ifndef HAVE_NS -static -#endif void update_window_cursor (w, on) struct window *w; --Apple-Mail-1--465062355 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii --Apple-Mail-1--465062355--