3 ms·
Debian displaced bash as root's default, and now uses the Almquist shell for performance reasons. I would be curious if mksh is also faster. ksh93 also claims
by chasil 5y ago
Debian displaced bash as root's default, and now uses the Almquist shell for performance reasons.
I would be curious if mksh is also faster. ksh93 also claims great performance increases, but it is no longer (well) maintained.
"Therefore, many interactive features are not present in Dash, making it faster and more memory efficient than Bash."
https://wiki.debian.org/Shell https://wiki.debian.org/Shell
- teddyh 5y ago> Debian displaced bash as root's default Um, no? Debian changed what /bin/sh is, which is what many shell scripts use, especially those startup scripts used by sysvinit. The shell of the root user remains, AFAIK, /bin/bash.
- b112 5y agoIndeed. Bash was used for sh emulation before, the reason given for the change to dash was that sh emulation was more correct with it. (I think it allowed bashisms even when called as sh)
- lhoursquentin 5y ago> I would be curious if mksh is also faster. ksh93 also claims great performance increases, but it is no longer (well) maintained. mksh `printf` is not builtin, so if the script makes heavy use of it then it tends to be slower than bash. ksh is very interesting because it has the ability to avoid spawning new processes on most command susbstitutions, making it usually much faster than all other POSIX shells. But again this depends heavily on what the script being executed is doing, here's a highlight of what I described: $ time mksh -c 'for i in $(seq 1000); do printf $(printf $(printf $(printf hello))); done' > /dev/null real 0m2.121s user 0m1.321s sys 0m0.875s $ time ksh -c 'for i in $(seq 1000); do printf $(printf $(printf $(printf hello))); done' > /dev/null real 0m0.013s user 0m0.008s sys 0m0.005s $ time dash -c 'for i in $(seq 1000); do printf $(printf $(printf $(printf hello))); done' > /dev/null real 0m0.311s user 0m0.279s sys 0m0.073s $ time bash -c 'for i in $(seq 1000); do printf $(printf $(printf $(printf hello))); done' > /dev/null real 0m0.664s user 0m0.538s sys 0m0.186s