From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: Remote asynchronous processes Date: Tue, 4 Aug 2020 18:48:39 +0200 Message-ID: References: <87tv1nwuv4.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7886"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs developers To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Aug 04 18:49:34 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k3086-0001yi-39 for ged-emacs-devel@m.gmane-mx.org; Tue, 04 Aug 2020 18:49:34 +0200 Original-Received: from localhost ([::1]:52262 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k3085-0002XV-1u for ged-emacs-devel@m.gmane-mx.org; Tue, 04 Aug 2020 12:49:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55692) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k307R-0001lB-As for emacs-devel@gnu.org; Tue, 04 Aug 2020 12:48:53 -0400 Original-Received: from mail-oo1-xc29.google.com ([2607:f8b0:4864:20::c29]:36917) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k307P-0003Qn-PC for emacs-devel@gnu.org; Tue, 04 Aug 2020 12:48:53 -0400 Original-Received: by mail-oo1-xc29.google.com with SMTP id l10so1512247oon.4 for ; Tue, 04 Aug 2020 09:48:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VoDduajqL21giE4/wnr+pMjmW33WGhpVvY8nes/FfQU=; b=mpIXV2kletScJaJy31UoByURtgmQhEA3d8AXIy+KQ27cHCdSY9j2trNM9hZ3CsVEYy fi5ICnW8UZ+ZSniwmhuqeF1uQYTeDkBXnEsya7NQrMxQsUT2wBXs6BrTwQgAnxT2wAri MJFUtc6/ikOvKziRXR5qDjFEKy4kfUxcQxnQqfCYmA+f0d6nICQ5OQv+pLxxKzUZl+Sw YJrD39ZZkqg0JOBBv+I9M/Tnz8MKeR0Yo/qhNdAGwYwl9AWWjONUqov2dJfJNtOD+oNO dvzfPr054dtr3PKyv+Paz/df9nguhcQeNOgAySQoD+mHy0mgRLcikKJ2wl2mGd8RHtUq RtcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VoDduajqL21giE4/wnr+pMjmW33WGhpVvY8nes/FfQU=; b=Qrad75nBviYIn/utC2xrlKJJadiTYyNpZm10A3aIYScoOAiGZEANUIFhv5RDJhg7XR yIAdi4oPejs5t/TlKNYnPPUsIEK7P3s+yIu8XT6s0blNuPBBXgH6Rl1sULeimcFvLFIV TYyetrMfMnQ2PRWJZA9Pgn1UMniLCulUi2eRT/P0rebLN1Jcw0WHvoAyyHzDu7npftfN Qhurx4Pi92Io2W0paegk6M8uSL6d9FJwjNFZuhp2Cm+tVHhBguVfWps4LycZ7B3ac4JK pOct64npMQSfCDXTwq6wg74qMRvmCt7bOwI9kGkPkikyg82EvRa7ND7YqLDr05BiWqG/ tlXQ== X-Gm-Message-State: AOAM530GzBMoPyMFF7y9K9YEvJBYKxB5tn3gYffhB6TOvMC3CWNuvJdA WNscQtG/s1n4azMQbq2iH1xxkM+KEvR+hvd17mk= X-Google-Smtp-Source: ABdhPJwthr/Z0Wx5igGld0TRXLC8S4E70IJlSYw2Cil6q/4OSg8J6MxT1L1VXlML9fmgWx+fk08MJd+mSbptIRD9Nus= X-Received: by 2002:a4a:9c0f:: with SMTP id y15mr19446123ooj.81.1596559730124; Tue, 04 Aug 2020 09:48:50 -0700 (PDT) In-Reply-To: <87tv1nwuv4.fsf@gmx.de> Received-SPF: pass client-ip=2607:f8b0:4864:20::c29; envelope-from=p.stephani2@gmail.com; helo=mail-oo1-xc29.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:253438 Archived-At: Am Mo., 13. Apr. 2020 um 12:19 Uhr schrieb Michael Albinus : > > Hi, > > On the Tramp ML, there is a discussion about performance of remote > asynchronous processes. start-file-process / make-process take too much > time to finish. > > One of the reasons is, that Tramp opens first a shell on the remote > host, performs sanity checks, and runs the command after that. Well, I > cannot change this in general; the sanity checks have been added due to > feedback from users. > > One idea to change the situation is, to remove all sanity checks from > make-process. That is, if a user has a default directory > "/ssh:user@host:/path/to/dir", and if he calls > > --8<---------------cut here---------------start------------->8--- > (make-process > :name "test" > :buffer (current-buffer) > :command '("cmd") > :file-handler t)) > --8<---------------cut here---------------end--------------->8--- > > this is translated directly into > > --8<---------------cut here---------------start------------->8--- > ssh -l user -o ControlMaster=auto -o ControlPath='tramp.%C' \ > -o ControlPersist=no host "cd /path/to/dir; cmd" > --8<---------------cut here---------------end--------------->8--- > > This would improve performance significantly. The drawback is, that > Tramp does not perform convenience checks, like password handling. > > start-file-process would not be changed, and it behaves like before. > > Comments? I think the approach is great, thanks for picking this up. A few minor comments: - I'd change start-file-process in lockstep with make-process. Since start-process is nowadays just a wrapper around make-process, it would be somewhat confusing if start-file-process behaved significantly differently. - I'd probably leave out the ControlMaster options entirely and rely on a working SSH config with a control master already started. That way the control master can be reused across arbitrary processes on the client machine, not just Emacs.