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

Re: Brace expansion performance



On Mar 22,  5:24pm, Radoulov, Dimitre wrote:
} 
} does anybody know why the zsh brace expansion (?) performs so ... 
} differently?

First make sure "zsh -c" isn't reading some expensive init files that
bash/ksh aren't, but:

I'm pretty sure zsh is actually allocating an array of 300000 integers
during expansion of that expression, and probably copying it a few times.

schaefer[633] strace bash -c 'echo $BASH_VERSION;echo $BASH_VERSION;for i in {1..300000}; do :;done' |& wc
    322    1262   17792
schaefer[634] strace Src/zsh -fc 'echo $ZSH_VERSION;for i in {1..300000}; do :;done' |& wc
 901381 5408181 43590584



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