From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 7446 invoked from network); 12 May 2022 06:16:37 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 12 May 2022 06:16:37 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1652336197; b=byHanANPvqEPQP0n0QwMFp1qmTaAolgDCA2ZLZmhIaRqx+Vv8jUQw110qALstBbuTsZICyMTl/ pDH6ETTBD0sx4IjHY2aa0sFNI3P7xbwtV5EWxqxVcHqzUtL5a1nX5JRvACgdDaSGlQ23Zkmivy Z5yD8bkqdJEIsIu4tP+o+KvPraG7DvMvUfl6DYVF9h78aEFEJS9Z8XxmXyFpeMZaL3ichwOzU/ Ucl8PubnQsrg2/q7KagI1Q6iAEbxuRhQsGTt7B6TFCY1czLtcSbBnDCQR1YE29ShU7RLaDyeHr JTPaOrE253yW7+VYx677ihPQWlwbnHCvfhOQSg9+LISV0g==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f48.google.com) smtp.remote-ip=209.85.218.48; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1652336197; bh=GstbQcVdmAXSpMQtY6wlY+m7kdI4FzRje2IeX22iJh0=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=Hp/vDj1tfAb6eNtiFjYj0kqvSsHf3x95Vh2/aCv7pbxlGj13BnU61Be74k87Cgprmn3TXkwrLt e6BqmHbuQL+ljUZIuovQM07my6+EF64GtEkweNCL0jcJ/LjKtbQHMTWw5gTftycf082UJBL0fc xQ4xjazisYbuSrmTtEyd9tMnpvTeb8CRtGHw6HaR09av3mk+tjY8z2T25L18srBI3Wf178/ozj JtxiKkiH4YGhgjV2VnqXf+osPbNpXh0cs5QBr6eipJ5Uzq5J3nzKDsmpSYlD83LouIugjcZd5A HUQ15TUoOFu0ikJTHktL6lEo485yPverq26cy0e3TpeEwA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=DyrzP+8bUcdU3hnfyzBZWWz55G7Iipe0IPS9Ar0CcP0=; b=q2P14pmJw4ZJYpoaxQUkp4uWWr /Bxfv+BQ9h90gJbAPfK+PSd1UrQB+sDWzgIqmbbhgTftSHfj+dwNoiEhod0zqHoA5znjls568jWSI PFxS0QNddjUqtweLI5eYeTDmE5FS4i+0X2aUR52sjNF6rmBSupBMn3bKJauWYnaxq5KDlaHyjs7KE 56Uz1RX2csCyoa0sI0fYgn6sJbo3hHjMqIi3hpaKMyjJobyTul9NGnDQ2WAVrEgcui7ZQI6F0iUAG kLdECkYE9MfTKQvwrwr1qdB8qFQbeS8m49CIu9x3res1VUKvD/0DjQGKCM39hd90F7AFGkNOTAsia tr7Nm8ZA==; Received: from authenticated user by zero.zsh.org with local id 1np27p-000KTT-8S; Thu, 12 May 2022 06:16:37 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f48.google.com) smtp.remote-ip=209.85.218.48; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ej1-f48.google.com ([209.85.218.48]:44860) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1np271-000JmQ-5x; Thu, 12 May 2022 06:15:48 +0000 Received: by mail-ej1-f48.google.com with SMTP id i19so8057999eja.11 for ; Wed, 11 May 2022 23:15:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DyrzP+8bUcdU3hnfyzBZWWz55G7Iipe0IPS9Ar0CcP0=; b=IeWL1tZhKbhLiFYE29sU7lUmR2l/OwN1/ToxNZXbWQ6T9g0K01McKmoQSPT263NeSE dLcXgzhXua1twlt+8nHCWJP4Y2txLa02X8Oh3VSBaWh04BEb0dyaA6rbhUCehgt9YQjZ OpXBm7pmhsCj9WIoVDRNc9FmfMuz+3iRSHCSiY96NQgmLql43wtwNWu3f869dvOI20Yp Q0uimtJOfW90CHysbNNhkSroBvd+KXtgWvyws1Y6QPPYSoav1EhZOsoL33IOWq4FZxv8 WnVqELIQijaYStpjf02lQtnQmleVn9/PZW/kfLrICbw+RT7caERdWMrVzrx98HNqG6JS yJ/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DyrzP+8bUcdU3hnfyzBZWWz55G7Iipe0IPS9Ar0CcP0=; b=SCcKkkU8BSDCxV8vUfcyqdP2sg8xxoHiHTm+ctQz6hIpJrWecoM9ULQxQ/qiakjcdq 5jIstjkDvMZjFyFtzECpJ0Rr8t7oG9YtL7RHP6rhCyx6yGANNpyYcp6Jmmy10cJALDUc h8383Vf+g40f6aIFaXjnFcjtRPwzN5ONMGkJ/xChH3/S+iuNLYgN1gJOnBDF0bOVeaJL bp7YsgYPrGW9SdRvNY5z9OVYuxouZfoQZeULZh8GRJboERqsF+4XX6/iBtdBl62/Ut6y gJcwZHVGaGDXNuPc2L1lxuQgTafN7phzhF7ugwExqWL3d8QsnxXqYPGK7HGSBqAIIjKW KgMg== X-Gm-Message-State: AOAM532WcHWWnJuU48WEOUuW+jWervQMAlKWUIDCJuc4RJPQ1GlC1haX /vg9paBUzXy+mUgN1YknymVOX0jfUt0O4T0BBbF2zg== X-Google-Smtp-Source: ABdhPJwI/BKI7JjTIb/IQm9/FFxHFa87moKiMaD6orMezGDriuQcSZ6wQk+eQqwh42NdzZeTZIJ7c9MdnUuT4owVnT0= X-Received: by 2002:a17:906:1e94:b0:6b9:6fcc:53fd with SMTP id e20-20020a1709061e9400b006b96fcc53fdmr28666774ejj.450.1652336146826; Wed, 11 May 2022 23:15:46 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Wed, 11 May 2022 23:15:35 -0700 Message-ID: Subject: Re: Commenting and large pipelines To: Zach Riggle Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" X-Seq: 27755 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: In addition to what Lawrence said ... On Tue, May 10, 2022 at 11:35 PM Zach Riggle wrote: > > 3. Is the use of {} better than ()? In most cases it won't matter. Putting something on the left side of a pipe in zsh already starts it in a subshell, and most such subshells are subject to an optimization such that zsh will exec the last command to replace the shell process. On the right side of a pipe, however commands in { } stay in the current shell whereas those in ( ) run in a forked subshell. > 4. How much of a performance hit does this make, versus hand-writing a different pipeline? It's definitely going to perform better than a pipeline built by assigning and expanding array parameters. Otherwise the performance difference should be minimal. > 5. Are there any ways to improve this? For example, replacing 'cat' in the default case. You're not going to do better than "cat" in that context.