4 ms·
Should be retitled My Faster Bash Startup. This had nothing to do with Bash itself and everything to do with the user. The big one is that Homebrew is abnormal
by encryptluks2 5y ago
Should be retitled My Faster Bash Startup. This had nothing to do with Bash itself and everything to do with the user.
The big one is that Homebrew is abnormally slow in general and they had multiple commands running homebrew in subshells.
- grepfru_it 5y agoIf you run ubuntu, disable all the call-home functions in /etc/update-motd.d to speed up your bash login session
- ta988 5y agoI was wondering why Ububtu logins were always that slow. This is ridiculous.
- dang 5y agoOk, we've consed My onto the title above. Thanks!
- adrian_b 5y agoI have never tried to measure the startup time for interactive bash, because my .bashrc only has a large number of environment variables and of command aliases, so I do not see any visible delay at startup. However I have tried to benchmark bash against zsh, to see if one of them is faster. The benchmark was inconclusive, because I have tried 2 scripts, but the execution times were essentially the same for both bash and zsh. The 2 scripts invoked a small shell script on each of about ten thousand files and various file attributes were tested and compared in some shell conditional expressions. Because the times were the same for bash and zsh, it is likely that the file operations dominated the execution time and not the shell startup time or the script interpretation, as I expected. The shorter benchmark corresponded to an execution time of about 10 millisecond per shell script, so this is an upper limit for the bash startup time in non-interactive mode on my computer. It is likely that the startup time was several times less. In conclusion, the startup of bash in non-interactive mode, when it does not source .bashrc or other scripts, is no more than a few millisecond. It is clear that someone who wants bash to start fast should be able to reach a startup time much, much less than a second.