4 ms·
From our experience, ksh is generally faster, and dash sits between ksh and bash. One reason is that dash stores variables using a very small hash table with on
by laurenth 2y ago
From our experience, ksh is generally faster, and dash sits between ksh and bash. One reason is that dash stores variables using a very small hash table with only 37 entries[0] meaning variable access quickly becomes linear as memory usage grows. But even with that, dash is still surprisingly fast -- when compiling `pnut.c` with `pnut.sh`, dash comes in second place:
ksh93: 31s
dash: 1m06s
bash: 1m19s
zsh: >15m
[0]: https://git.kernel.org/pub/scm/utils/dash/dash.git/tree/src/var.c#n66 https://git.kernel.org/pub/scm/utils/dash/dash.git/tree/src/...
EDIT: ksh93, not ksh
- AdmiralAsshat 2y agoPeople still use KornShell?
- chasil 2y agoAll of Android is still based on a pdksh-derivative known as mksh, which is an enormous install base. http://www.mirbsd.org/mksh.htm http://www.mirbsd.org/mksh.htm OpenBSD switched their default shell to their own pdksh-derivative known as oksh. https://github.com/ibara/oksh https://github.com/ibara/oksh There was an effort to (re)start ksh93 development, but AT&T halted this effort. The bugfixes from the failed effort have moved back into Korn's last release. https://github.com/ksh93/ksh/tree/dev https://github.com/ksh93/ksh/tree/dev
- cb321 2y agoFor me `dash` compiles in just a few seconds. If you link to a 1-line problem (here, #define VTABSIZE 39), then why not boost that to 79 or 113, say, re-compile the shell and re-run your benchmark? Might lead to a change in upstream that could benefit everyone.