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: Sat, 8 Apr 2017 20:19:59 +0100 Message-ID: <20170408191959.GA7541@breton.holly.idiocy.org> References: 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 1491679283 19673 195.159.176.226 (8 Apr 2017 19:21:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 8 Apr 2017 19:21:23 +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 Sat Apr 08 21:21:18 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 1cwvv0-0003RE-18 for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Apr 2017 21:21:06 +0200 Original-Received: from localhost ([::1]:56298 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cwvv5-0004tA-M4 for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Apr 2017 15:21:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45352) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cwvuz-0004t5-8s for bug-gnu-emacs@gnu.org; Sat, 08 Apr 2017 15:21:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cwvuw-0002Yo-5W for bug-gnu-emacs@gnu.org; Sat, 08 Apr 2017 15:21:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40258) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cwvuw-0002YX-0m for bug-gnu-emacs@gnu.org; Sat, 08 Apr 2017 15:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cwvuv-0000tx-Qo for bug-gnu-emacs@gnu.org; Sat, 08 Apr 2017 15:21:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Apr 2017 19:21:01 +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.14916792113378 (code B ref 26397); Sat, 08 Apr 2017 19:21:01 +0000 Original-Received: (at 26397) by debbugs.gnu.org; 8 Apr 2017 19:20:11 +0000 Original-Received: from localhost ([127.0.0.1]:38457 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cwvu7-0000sQ-H5 for submit@debbugs.gnu.org; Sat, 08 Apr 2017 15:20:11 -0400 Original-Received: from mail-wm0-f65.google.com ([74.125.82.65]:35013) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cwvu5-0000sC-IG for 26397@debbugs.gnu.org; Sat, 08 Apr 2017 15:20:10 -0400 Original-Received: by mail-wm0-f65.google.com with SMTP id d79so3342353wmi.2 for <26397@debbugs.gnu.org>; Sat, 08 Apr 2017 12:20:09 -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=4tucQYHtFM3QeW/GT6ElMv46bSDhTPGQN9GyEHvgWDE=; b=t/up6xCcYrGMyjtcOyfp5c5TzqZ5d3rPmKfZ59s36/TqbehQ6J1q5+wdgVLH4HcjBl fLlsMxTKPK9TwPHpjSz9w1K7wKkbKr7dclEmOt40rzUFLptM8n3Tfw/l/zWLx7AoHtHd aTUCaza63WV6ncFn2IXGy6gYQvl2MtPNT3hhniCjI0HUtnJdWI3QynbCaQRVKHnRAEe4 xTNxiKTo3xIq8cYIbzwWTjwmstwEbyWgEbfcgbEij2KSiofs0XrR5klnTRLjPojRbDsT Re4YTGzmupVK/OJtSzZ93P56rIXVjfLnUQeNd2pxDMjogR6HMMAA/ptqlpAh6MVgU4Q4 ZOgQ== 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=4tucQYHtFM3QeW/GT6ElMv46bSDhTPGQN9GyEHvgWDE=; b=Nj+O/YCHAYXBDCKYTnotqxe8zvzkAbT/Mc5TtDXygbNLe6lG2md0lHob66E68qw5gH ynJ3IRfIhu70UDMWabef6EmwlcbCjYX1b6uV8bTt3/t7Bi1RYApVSkupoI2mfO0RuoyF YMQAYIT5HU6qM4lBkhF5HGworwFVwVPRmYF4036vFuIvZUHIF0heMwBSHVz1nPq/qdl4 7LV32wmVs+T9pbAYO3oEhcwxhhupvSAfHcaPr6Hf+Fn/BOw+Awpe6zEroqayoKr7j2Nl bk05vDH7yHsNIFIFQjcFBWtdYYGffPiX76ogbdXAiUk79hISMXBHpbieeU+bCSq2kQRt 7YjQ== X-Gm-Message-State: AN3rC/5UoUnwmECcGu7jTgNmx2OfDKRcyK/jq7YUSkTGOtXMYmIguSWQ ymUQF/c2IUXEAQ== X-Received: by 10.28.54.7 with SMTP id d7mr4047107wma.114.1491679202855; Sat, 08 Apr 2017 12:20:02 -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 36sm10828648wrk.15.2017.04.08.12.20.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Apr 2017 12:20:01 -0700 (PDT) Content-Disposition: inline In-Reply-To: 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:131384 Archived-At: 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 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. However I can’t tell for sure if that function is allowed after vfork, as I can’t even find any official reference to setsid not being allowed. I’m probably just not looking hard enough. It seems the ‘correct’ solution for macOS is to use posix_spawn instead of (v)fork/exec, but that would probably require a larger change, and Daniel Colascione seems to have looked into it before, and come across this very issue: https://lists.gnu.org/archive/html/emacs-devel/2012-01/msg00078.html He doesn’t seem to have got an answer, though, and Emacs no longer falls back to setpgid on any platform (see commit dd0333b6155c9c3aabdac9418c005e2e5b4796e7). > How might I test that? The call to setsid is inside an `if` that’s to do with ptys. I suspect it must come into play if you’re using Emacs in a text terminal, rather than as a GUI app. I can’t check this just now as my master won’t build... -- Alan Third