From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#26397: 25.1; call-process slow on macOS and slower on larger frames Date: Sun, 9 Apr 2017 14:01:55 +0100 Message-ID: <20170409130155.GA59432@breton.holly.idiocy.org> References: <20170408191959.GA7541@breton.holly.idiocy.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1491742998 6861 195.159.176.226 (9 Apr 2017 13:03:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 9 Apr 2017 13:03:18 +0000 (UTC) User-Agent: Mutt/1.7.2 (2016-11-26) Cc: 26397@debbugs.gnu.org To: Aaron Jensen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 09 15:03:13 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxCUm-0000fS-9q for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Apr 2017 15:03:08 +0200 Original-Received: from localhost ([::1]:58621 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cxCUs-00078j-8h for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Apr 2017 09:03:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56332) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cxCUm-00078d-1r for bug-gnu-emacs@gnu.org; Sun, 09 Apr 2017 09:03:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cxCUi-0004Nn-5t for bug-gnu-emacs@gnu.org; Sun, 09 Apr 2017 09:03:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40864) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cxCUi-0004Nc-1p for bug-gnu-emacs@gnu.org; Sun, 09 Apr 2017 09:03:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cxCUg-0004EM-ID for bug-gnu-emacs@gnu.org; Sun, 09 Apr 2017 09:03:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 09 Apr 2017 13:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26397 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 26397-submit@debbugs.gnu.org id=B26397.149174292716196 (code B ref 26397); Sun, 09 Apr 2017 13:03:02 +0000 Original-Received: (at 26397) by debbugs.gnu.org; 9 Apr 2017 13:02:07 +0000 Original-Received: from localhost ([127.0.0.1]:39063 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxCTm-0004D9-U8 for submit@debbugs.gnu.org; Sun, 09 Apr 2017 09:02:07 -0400 Original-Received: from mail-wm0-f65.google.com ([74.125.82.65]:35834) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxCTl-0004Cg-5u for 26397@debbugs.gnu.org; Sun, 09 Apr 2017 09:02:06 -0400 Original-Received: by mail-wm0-f65.google.com with SMTP id d79so5385850wmi.2 for <26397@debbugs.gnu.org>; Sun, 09 Apr 2017 06:02:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=m+58+/dUENuiolvb3mCwCadNat26CRQI3a10U+NNQWQ=; b=LD7KJzhVz8kJb9Cn763KZgLb8xE91dFPgI3oz0snOv7X5D8b+1UWSXYR8wrO5GO5+D SgVJO8Z/WooxGyIWSIn3Rk3i76XlhvM/N5hRfI/g78IasG5KJrrp6Djwbqt/gIXqsEE7 11XALNJGUUF92TxNESv/lmqyHypq/lPatfD7SHsnwK0xfz0crCBFqbk7mB2FlF/05pvO yo5sBIzHGXe7nr2HfY0ASbVJciLapVXRHl9bFavtMBVkfu8FhDsupdGe7LKOonLZulc0 WLz5XLXI/2k7SoI3lKdrMZUBNOb1U0cybkdq13k+7xsf8YkvrR1gn3KV90OGdbTfiZ9B IWrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=m+58+/dUENuiolvb3mCwCadNat26CRQI3a10U+NNQWQ=; b=pKBm0S/QllSuyXBh80EsfpggYg9A63Y7X6179hHOudFCiIFhcVrM6hcDV7GA78PxkX 2XNOJ5zGdxYZdLUOQ4SBmMIc+AcXJAR6TZnS8k4nlKqJ3Are7VAqYHpufJ5TchH9d9dU NlcfCBvfWIwLDzQPraY9hASCHbkSDeIGP6ZA9Kc+hrU8zyhUf0uNpK34G8tzdoC3LaF3 4a/tUw6LG3hrgaCA3iqmGYIlCTkFiU4R0SojQ7Wqr+k9a/nEMAv5fCpha12pjogsj5mN CHZtf8tSUkJzR/1Jpkc/j3dXS0dL2FVYlb6Kfc7yknexHcG0mo+KrV9mEQyQXOv++t5+ VmTQ== X-Gm-Message-State: AN3rC/709WwHF2GbJHJ424+jtVW0rkKwq7BnRAIb3+vgFKMPVAH5/72z UmxyeEZT0eiGMQ== X-Received: by 10.28.216.141 with SMTP id p135mr6657230wmg.71.1491742919131; Sun, 09 Apr 2017 06:01:59 -0700 (PDT) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-6ca6-4e08-5c7a-e665.holly.idiocy.org. [2001:8b0:3f8:8129:6ca6:4e08:5c7a:e665]) by smtp.gmail.com with ESMTPSA id z38sm13549312wrc.36.2017.04.09.06.01.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Apr 2017 06:01:58 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20170408191959.GA7541@breton.holly.idiocy.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:131409 Archived-At: On Sat, Apr 08, 2017 at 08:19:59PM +0100, Alan Third wrote: > On Sat, Apr 08, 2017 at 08:47:25AM -0700, Aaron Jensen wrote: > > On Sat, Apr 8, 2017 at 12:37 AM, YAMAMOTO Mitsuharu > > wrote: > > > > > > Probably "fork" copies some GUI resources. That would also explain > > > why the performance is worse on the Mac port, where each frame > > > allocates an extra NSWindow for overlaying. > > > > > > It becomes much faster and seemingly unaffected by the frame size if > > > you comment out "#undef HAVE_WORKING_VFORK" and "#define vfork fork" > > > in src/conf_post.h. But I'm not sure if it is safe. > > > > Wow, that does make a big difference. The comment says that Emacs > > hangs when evaluating: > > > > (make-comint "test0" "/nodir/nofile" nil "") > > > > But I can not reproduce that currently with vfork. I can’t reproduce a hang with that command either. > > I do not understand the second comment: "Also, setsid is not > > allowed in the vfork child's context as of Darwin 9/Mac OS X > > 10.5." > > It looks to me like we could replace the call to setsid with > > setpgid (0, 0); > > for Darwin builds. No, forget that. It doesn’t do the same thing at all. If you run Emacs, then M‐x ansi-term RET RET You should get a shell prompt. Using fork/setsid, your shell will be able to do job control, but using vfork it can’t. You can test this by typing the `bg` command. Zsh (and I assume bash, etc.) responds by telling you either there are no jobs, or that the shell has no job control. We could work around this in a rather ugly manner by doing something like: #ifdef DARWIN_OS if (pty_flag) pid = fork (); else pid = vfork (); #else pid = vfork (); #endif which would use fork where we’re expecting to run setsid, and vfork otherwise. -- Alan Third