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

slow startup of zsh (1x slower than bash)



Hi,

The following example shows that zsh startup time is much slower than
other shells. Can this be improved to at least as fast as bash?

==> main.sh <==
#!/usr/bin/env bash
# vim: set noexpandtab tabstop=2:

set -v
TIMEFORMAT=%R
time for ((i=0;i<100;++i))
do
    :
done
time for ((i=0;i<100;++i))
do
    ./script.sh
done
time for ((i=0;i<100;++i))
do
    ./script.dash
done
time for ((i=0;i<100;++i))
do
    ./script.bash
done
time for ((i=0;i<100;++i))
do
    ./script.ksh
done
time for ((i=0;i<100;++i))
do
    ./script.zsh
done
==> script.bash <==
#!/usr/local/bin/bash
==> script.dash <==
#!/usr/local/bin/dash
==> script.ksh <==
#!/usr/local/bin/ksh
==> script.sh <==
#!/bin/sh
==> script.zsh <==
#!/usr/local/bin/zsh
$ ./main.sh
TIMEFORMAT=%R
time for ((i=0;i<100;++i))
do
    :
done
0.001
time for ((i=0;i<100;++i))
do
    ./script.sh
done
0.339
time for ((i=0;i<100;++i))
do
    ./script.dash
done
0.387
time for ((i=0;i<100;++i))
do
    ./script.bash
done
0.486
time for ((i=0;i<100;++i))
do
    ./script.ksh
done
0.538
time for ((i=0;i<100;++i))
do
    ./script.zsh
done
0.953

-- 
Regards,
Peng



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