Tim Retout's www presence

Mon, 24 Mar 2008

Shell startup times, part 2

Following up on Saturday's post and various other blog entries about bash.

While arguing with Anton about bash being slow, I discovered that /etc/bash_completion was sourced twice when starting a shell on my laptop; once in /etc/bash.bashrc, and once in ~/.bashrc. This is Debian bug #430501 - the suggestion there is that /etc/skel/.bashrc should change to check whether /etc/bash_completion had already been included. So, that saves 0.27 seconds.

tim@regulus:~$ time bash -i -c exit
exit

real	0m0.270s
user	0m0.240s
sys	0m0.032s

This is still ages when compared to zsh. A solution is proposed in Debian bug #467231 - the functions could be loaded dynamically when they are first used, instead of all at once. I may try this next.

One sandwich and cup of tea later: it works, and bash now beats zsh's time.

tim@regulus:~$ time bash -i -c exit
exit

real	0m0.047s
user	0m0.036s
sys	0m0.004s

Posted: 24 Mar 2008 00:00 | Tags: , , , ,

< March 2008 >
SuMoTuWeThFrSa
       1
2 3 4 5 6 7 8
9101112131415
16171819202122
23242526272829
3031     

Contact

Tim Retout tim@retout.co.uk
JabberID: tim@retout.co.uk

Comments

I'm afraid I have turned off comments for this blog, because of all the spam. Let's face it, I didn't read them anyway. Feel free to email me.

Links

Copyright © 2007-2011 Tim Retout