Sunday, July 24, 2011

Hmm, bash_completion REALLY slows down the shell

On dixie, I generally used zsh, but have been using bash on alice, since that's what I use at work. On the other hand, while zsh is _so_ big, I could never expect it to be fast, on alice, I find that opening a new shell takes irksomely long.

Tests: (avg m:ss reported by GNU time -v)

		no profile, no completion	= avg 0:00.01
		with profile, no completion	= avg 0.00.10
		no profile, with completion	= avg 0:01.16
		with profile, with completion	= avg 0.01.27
		no profile                  	= avg 0.00.00 # to fast to be timed?; highest was 0:00.03
		with profile                	= avg 0.00.08

Ok, so maybe an Atom based netbook isn't as powerful as a server with multiple quad core Xeons but that is still a rather big difference. No wonder though—on alice, /etc/bash_completion is 1700 lines and /etc/bash_completion.d contains over 25,000 lines of scripts to source.

My shell profile only adds like 700 lines of code when run on Linux. Although zsh really made me appreciate context-sensitive tab completion, the only interest I have with it in bash, is pretty much for git.


No comments:

Post a Comment