Re: [PATCH] compinit forks less

Charles Blake <[email protected]>
Newsgroups gmane.comp.shells.zsh.devel
Message-ID <CAKiz1a-Shjp7oSKedMH4cRmxnin-nWYKyxY0N8M2igqbgmSDCQ@mail.gmail.com>
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.)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.