From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id 21F4024619 for ; Thu, 23 May 2024 02:30:59 +0200 (CEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1716424259; b=XYB9m2joIktNrQ0GxqBui0Dyttuh4bn3DCgBX224aEJ+0LipecCLgOxR4/VGVLlUkzUb0330NU Odz8d4RIsT4vS7MI2FFFhrad3MjAhI8vaOwLglP8hTrMWPivIqGJ24FqzA+2W5ok1/4lPuR2NQ p0Px0Rbw6IffYAFxDWd2UsAnfODoM+qMmSeWqJFFRFBeyCm2e3y2vZPWci2WsGhw02ZdvO5kiN l6xV9MlqBJKUlMUmPlI2tcX44UfmpQ3uw/Yl/mu4QpgYHDpPu1uvsrxGAfIpFTvQjGALBmvhZo OujlKBiCQ04TP5TCwlhi8jT+fgCvfmGU8men9FTBvNv0dw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta02.eastlink.ca) smtp.remote-ip=24.224.136.13; dmarc=none header.from=eastlink.ca; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1716424259; bh=og95mSBaMt8zPZPNsxpYlC1VD8stJh4qTOdmA5mS/rU=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:From:References:To:Subject:MIME-Version:Date: Message-ID:Content-Type:DKIM-Signature; b=P3PaqEoOzWe+efmb8UGylIpNhk0wyqfmNGK/EZX8tB2+t5/yrp8pl5wWehOQPztuVzt36fAadC XiUFR8yKbUH2XdPLDF1v1IrkCHfFizJJIYqVLf+dP3D3RVTWPgdrQLdXLp/iNYULnPM9SuB1lk apEhtNOsLcF28H4iIB4O3fPnPu1nIUIXvN8t8wofzw28XYh6LqRSlkpuoin7XOLTxvNCMnoHzK 7hI5wu9fCW23UV0WBYI1oqXaRpJ6Nf+gIXFBO4n5Y2n8ghlQ8+97owS9qBXsI2ut6RhrLx89L2 yB4og+WTqdUeFHAvvKHJUIJ+7UXxD4RiQFI1ARtZEvKjOw==; 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:In-reply-to:From:References:To: Subject:MIME-version:Date:Message-id:Content-type:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=kDQu2eh7vVzaB5aEEN9IekMdJSaUKYUWW7YD9U9u2Sc=; b=TyWg+W2SgHMTXbNnX+uiZUaXg3 vV/GdxxqrD/xpSklxEZKlw6F4i0mzym65z6v+LQQ3MMBZbS+i4tyJ0zs6ZMxM0JNsXMqb/KVL0Uk0 LUKalxc12htNvxf7dWhuhmBTZ0g15Ys+PyYpZQzAmpRLxSGtdWwymIgIUNFS2ma0T5WkNVMn2yz8w hfTg0kiF/Fa4yvQ2aZQsApUUzXRyxFCEu5CFCpTW3ApzaQilzIVzt6NKcqbtJ5moKTyGUM3a3ST3j h5qruUncOOF04gL3Q3O+RChJ4v8jnx0EtAjq13RibM6tgP53f+Tw/AFqyaAwdGQ71zeR/AdbJFtxX aQIDlDQw==; Received: by zero.zsh.org with local id 1s9wMF-0003cC-Es; Thu, 23 May 2024 00:30:59 +0000 Authentication-Results: zsh.org; iprev=pass (mta02.eastlink.ca) smtp.remote-ip=24.224.136.13; dmarc=none header.from=eastlink.ca; arc=none Received: from mta02.eastlink.ca ([24.224.136.13]:39995) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1s9wLg-0002uU-38; Thu, 23 May 2024 00:30:24 +0000 Received: from csp02.eastlink.ca ([71.7.199.167]) by mta02.eastlink.ca ([24.224.136.13]) with ESMTPS id <0SDW2CET4XA5G2D0@mta02.eastlink.ca> for zsh-users@zsh.org; Wed, 22 May 2024 21:30:22 -0300 (ADT) Received: from [192.168.0.15] (host-24-207-19-13.public.eastlink.ca [24.207.19.13]) by csp02.eastlink.ca ([71.7.199.167]) with ESMTPSA id 9wLesLVXZxAjx9wLes9vyN (version=TLSv1_2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256); Wed, 22 May 2024 21:30:22 -0300 X-Authority-Analysis: v=2.4 cv=EfprQ+mC c=1 sm=1 tr=0 ts=664e8e1e a=e7T7DzMKK1R988ZCg0wLyw==:117 a=e7T7DzMKK1R988ZCg0wLyw==:17 a=r77TgQKjGQsHNAKrUKIA:9 a=Pty5ayAZo-hl0MoQBV0A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=ZLGELXoPAAAA:8 a=MXoj3SZhHZyU9916-JkA:9 a=6PIFaOO5EuyqeM4W:21 a=_W_S_7VecoQA:10 a=CFiPc5v16LZhaT-MVE1c:22 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdeihedgfeehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecugfetuffvnffkpffmpdfqfgfvnecuuegrihhlohhuthemuceftddtnecunecujfgurheptgfkffggfgfuvfhfhfgjsegrtderredtvdejnecuhfhrohhmpeftrgihucetnhgurhgvfihsuceorhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrqeenucggtffrrghtthgvrhhnpefhteethfevgeeuvdelgefgvdevudefueduffdvgfelvddvgfdtieegueeuleeifeenucfkphepvdegrddvtdejrdduledrudefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdegrddvtdejrdduledrudefpdhhvghloheplgduledvrdduieekrddtrdduhegnpdhmrghilhhfrhhomheprhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepreerpdhrtghpthhtohepiihshhdquhhsvghrshesiihshhdrohhrghdpghgvthdqkghiphfrrghsshifugepthhruhgv X-Vade-Score: 0 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Content-type: multipart/alternative; boundary="------------5lIWRzbgT90tym4r080faqDu" Message-id: Date: Wed, 22 May 2024 17:30:21 -0700 MIME-version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: the splits To: zsh-users@zsh.org References: <75784205-3d78-4dd8-8474-e2eb48598307@eastlink.ca> <0b6a048b-4fbf-4162-a31a-d5f6f963d72a@eastlink.ca> <91c546cf-ec25-49ff-bd14-b6f3105e0d12@app.fastmail.com> <8b434c8d-4618-49bd-998b-72644a2727fd@eastlink.ca> <527f680d-6c71-4eb0-9586-bb4cd253b76e@app.fastmail.com> Content-language: en-US From: Ray Andrews In-reply-to: <527f680d-6c71-4eb0-9586-bb4cd253b76e@app.fastmail.com> X-Seq: 29971 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: This is a multi-part message in MIME format. --------------5lIWRzbgT90tym4r080faqDu Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2024-05-22 17:04, Lawrence Velázquez wrote: > Yes, it's quite common -- borderline universal -- to start with sed > and pick up awk later. Good to know.  Sometimes I think I get everything wrong. > You take this way too far, in my opinion. Compared to appropriate > external tools, zsh-heavy solutions often perform poorly and are > more difficult to understand and maintain. (Compare your original > code to the awk solutions Mark and Roman offered.) Most of your > code would improve if you (judiciously) used more external utilities > and less zsh. It seems 'obvious' that internal code would be faster, but I know from Roman's various tests over the years that it ain't necessarily so.    Besides, at the concept level, shells are intended as glue between system commands and all their internal abilities are addons.  I suppose when,  as you say, one replaces a multi line internal construction with a single line construction that calls an external prog. the mere fact of many lines to interpret has a penalty right there that you'd not notice in a compiled program. --------------5lIWRzbgT90tym4r080faqDu Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

On 2024-05-22 17:04, Lawrence Velázquez wrote:
Yes, it's quite common -- borderline universal -- to start with sed
and pick up awk later.
Good to know.  Sometimes I think I get everything wrong.
You take this way too far, in my opinion.  Compared to appropriate
external tools, zsh-heavy solutions often perform poorly and are
more difficult to understand and maintain.  (Compare your original
code to the awk solutions Mark and Roman offered.)  Most of your
code would improve if you (judiciously) used more external utilities
and less zsh.
It seems 'obvious' that internal code would be faster, but I know from Roman's various tests over the years that it ain't necessarily so.    Besides, at the concept level, shells are intended as glue between system commands and all their internal abilities are addons.  I suppose when,  as you say, one replaces a multi line internal construction with a single line construction that calls an external prog. the mere fact of many lines to interpret has a penalty right there that you'd not notice in a compiled program. 


--------------5lIWRzbgT90tym4r080faqDu--