Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] compinit forks less
- X-seq: zsh-workers 54428
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Charles Blake <charlechaud@xxxxxxxxx>
- Cc: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] compinit forks less
- Date: Thu, 30 Apr 2026 11:00:51 +0200
- Arc-authentication-results: i=1; mx.google.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=j8DTNLoj4Fa59dvfK1tvrM5tOetGq9A3EFQ8SLqjyq8=; fh=lNwkaVSUgCqMTMeZdgLy2I+b6F4zkEqzT0VbYWrffUU=; b=bVmsPw7D5mEER5ZrJelfIbWX2U3IcoxIEehJDrYy6KB+pHPPfwllcFH3IigTchILv/ O5bqPmE1/UljqepN3Qe7wr5vgFV4CqpFuvxMsCzMSma+cyToI1w3tMDoqRdhJpyVdiJZ 8yju/6MQmO6cde1r58BWr8i3q/X9/5pYI2TwrFUPYSUnrNdcB5G0gmRks8eH00DPWWJw aIx8MBvPNgUciC+4Nnh86Cy2ET95CYc373NXsOudbVFUTRzMOLATWVqGtixhhbsLdI4D mkquBU1XLBrR2URYNpNA8nFm+NS9SVLXUnsxJxDukh0dgCPiN4OEp9W/HiP+nGl63c6O np8Q==; darn=zsh.org
- Arc-seal: i=1; a=rsa-sha256; t=1777539665; cv=none; d=google.com; s=arc-20240605; b=kl7OU4pDzhpFlZ7VVY10+s/Z2yEgbC3jGcalfS1kActGFkbk8WVHTj+y64GdYuTAcg eCzlvbMFZMPps85JvTanM24lDtg94Sdw0bA5EyhpQ5CDB4XXPabdoJJJX1F65TVgvtuz 1oNBU4timPIqnWObNhrUIgbMI/IY7LTItL0lOav41cPiWnB5EJCPw2OJ9xGogeMIVLj8 Xulss5opq5liBsnhrf9pB6iBAQ5ej24uLV7Its/5hrfhb9gbZWnYqF+rMTAWwJVNFE/4 uyxhDlL3tZEUn0qR1RhIWUE1LMGVyEQTSQ+Fz+KSklEOzApFuqxoauJdvQMSHBTs58ch 7hGg==
- Archived-at: <https://zsh.org/workers/54428>
- In-reply-to: <CAKiz1a-Shjp7oSKedMH4cRmxnin-nWYKyxY0N8M2igqbgmSDCQ@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAKiz1a_X09-MpXhOwtD2H4tykBi9HTkLq52Xirc25WHXsmjn4w@mail.gmail.com> <CAHYJk3RhWiAuZLXSXhhRrwJswsYHBR5Vs9Q_iFoWm+28TRX9Tw@mail.gmail.com> <CAKiz1a-Shjp7oSKedMH4cRmxnin-nWYKyxY0N8M2igqbgmSDCQ@mail.gmail.com>
On Thu, Apr 30, 2026 at 10:46 AM Charles Blake <charlechaud@xxxxxxxxx> wrote:
>
> Yeah. I didn't really work through all the complexity of an
> array-based solution, but you make good points toward the
> "this patch is simplest" idea. In any event, it can also be
> just a step in the right direction.
>
> I started with `strace` as well, but at least on Linux with
> sequentially increasing PIDs you can do this to count forks:
> a=($(zsh -c 'echo $$; zsh -lic echo\ \$\$; :'))
> echo $((a[2] - a[1]))
> and many other ways like `grep processes /proc/stat` (with
> various assumptions about system activity across the polls).
> `strace` is most precise, of course.
>
> I've been using this patch without issue since around October,
> but since release talk is gearing up, I thought I should post
> it. Only about a 5..10% performance effect for me, but some
> systems might fork much more slowly. (Cygwin used to be like
> that, for example.)
It's worth pointing out that this <<< ${ foo } method does create a
temporary file for the redirect instead, the data doesn't just
magically appear on stdin. But that's presumably fine.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author