Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: The speed of zsh



On Aug 25,  4:25pm, Zoltan Hidvegi wrote:
} Subject: Re: The speed of zsh
}
} > } Somehow ksh spawns external commands twice as fast as zsh.
} > 
} > I suspect it has something to do with zsh's use of pipes for synchronizing
} > parent and child processes
} 
} It the script I tried there was only a process substitution which does not
} use synch pipes.

I was never sure whether you were always talking about that script or if
you'd done some other profiling as well.  My remark wasn't specific to
the script.

} Anyway I did remove synch calls and it did make zsh a bit
} faster even when it executed scripts which never before used synch perhaps
} because of the better use of CPU cache.  [...]
} 
} Attached is the patch to remove pipe synchronization code.

This needs to be tested carefully to make sure various combinations of
piping to and from builtin loops and simple builtins still work right,
and to make sure zsh still returns the correct exit status from pipelines
where later elements exit before earlier elements are finished; especially
pipelines where a command on the rhs (or in the middle) fails to execute
and therefore exits immediately.

I forget all the reasons why the pipe-sync stuff was added long ago, but
I think those were the kinds of situations involved.


-- 
Bart Schaefer                             Brass Lantern Enterprises
http://www.well.com/user/barts            http://www.nbn.com/people/lantern

New male in /home/schaefer:
>N  2 Justin William Schaefer  Sat May 11 03:43  53/4040  "Happy Birthday"



Messages sorted by: Reverse Date, Date, Thread, Author