*nix Shells Benchmarked!

I found a benchmark of popular *nix shells.
Here's the resluts:
unix.stackexchange.com/questions/148035/is-dash-or-some-other-shell-faster-than-bash/148098#148098

Here's links to the shells:
gnu.org/software/bash/
zsh.org/
busybox.net/
github.com/att/ast
gondor.apana.org.au/~herbert/dash/
mirbsd.org/mksh.htm

Other urls found in this thread:

github.com/jwilm/alacritty
github.com/att/ast
mirbsd.org/mksh.htm
twitter.com/SFWRedditGifs

Don't forget to use a GPU-accelerate terminal for going VERY fast at INCREDIBLE high speed
github.com/jwilm/alacritty

There's this shit.
There's Crypto mining.
Do people even use GPUs for graphics anymore?

I bet rc would beat them all

Isn't that the Plan9 shell?

sure, but why not use them for many more tasks that they work well in? they're vector processors, GPU is just a buzzword that caught on in the 90s

We should argue about what?
Shell performance doesn't matter for most of us anyways

Why would they when the best games are from the 16 bits age?

Good point

It matters because autism

dash is the greatest and the only shell you need to keep for posix compliance. As for interactive use, do yourself a favour and drop shitty posix shells for literally anything else.

I've been playing around with using ksh as an interactive shell. its tab completion is really comfy, with it putting the options in a pretty little numbered list, and you can type the numbers and press tab again to have it autocomplete that option.

What is your favorite interactive shell?

elvish atm, fish is pretty okay too. ion seems to have potential but I haven't tried it yet.

lol u sound like my dad

I get that a lot. I'm only 22 though

fish is comfy

I'd actually like to use dash, but it has no tab completion whatsoever. That's the dealbreaker for me

Where is muh fish?

here is your fish, owo

bump

cute :o)

Maybe try out the different ksh that exist. I like ksh93.
>no tab completion whatsoever
But the ash I used did have filename completion, though not command completion. Perhaps ash is more updated on FreeBSD than in Debian.

I think dash is different from ash. dash I think was created specifically to be the /bin/sh on debian to make system shell scripts go as fast as possible.

As far as ash goes, i do know it's the shell that's bundled with busybox, so any busybox-based systems will have the ash with tab completion.

What about mksh? suckless suggests it

So what's up with ksh93, is it alive or what? Are there any active people maintaining it nowadays?

Believe it or not, yes.
github.com/att/ast
originally this was a bundle for all the AT&T shit, but now the repo is dedicated entirely to the development of ksh
last commit was 20 hours ago

mksh is here
mirbsd.org/mksh.htm
It's the successor to the public domain ksh (different from ksh93).

Yeah but is it a good shell overall?

I didn't even know my shell was so slow. I don't even notice

What are the practical implications, exactly?

I can't speak on its use as a language, but as an interactive shell, it's a lot less unusual compared to ksh, for better or for worse. There's no neat numbered list thing for the tab completion, and it just feels pretty standard. very bash-like. Apparently it did slightly worse on the benchmark than ksh, and the license is permissive rather than copyleft, again, for better or for worse

for interactive use, it doesn't matter
debian switched the default login shell to dash from bash in debian 6, and immediately they had massive startup speed improvements.
Of course, they had to rewrite every startup script to be POSIX compliant but it was worth it.

>i do know it's the shell that's bundled with busybox
Perhaps that too, but the original upstream for the almquist shell was BSD, but I imagine it's been forked many times since then.
Dash was originally a fork of NetBSD's ash, quite some time ago.
>So what's up with ksh93, is it alive or what?
Sorta. The most recent release is from 2014, ksh93v-, though many package repositories still keep a 2013 release, ksh93u+, unfortunately. On github, we can see:
>As of November 2017 the development focus has been shifted to the ksh93 command and libraries required to build it.
Korn himself still is involved, among others, so hopefully there'll be a 2018 release.

>practical implications
I imagine this means a hell of a lot more if you actually write scripts, as the speed thing was apparently enough of a factor for Debian to adopt dash, as mentioned here I guess it makes a slight difference for interactive use too (I think I notice things outputting slightly faster, but that may be placebo)

Whats the best minimal shell then?

My friend, I am from the 90s, we call them graphics cards.

My money is on Dash or Fish.
Minimal vs esoteric respectively.
ZSH is too bloated and not as useful without omzsh or other extensions.
BASH is much slower and distros generally use (D)ash with a BASH overhead for the scrubs.
Prove me wrong.

>no fish
D R O P P E D

Honestly if we're talking about /minimalism/ here, I think busybox might be the best. ash has the basic comfy tab completion, and is very fast and lightweight as well. Busybox as a coreutils is also meant to be lightweight too, so there's that

can this work on Gnome3/Sway ie wayland!??
MUH DIGG

It's defintely not placebo.
Dash is much smaller than Bash and has less specialized commands it's much more focused which allows faster I/O.
It's basically like C vs C++.

From the wiki page on busybox:
>the single executable replaces basic functions of more than 300 common commands
>Since each Linux executable requires several kilobytes of overhead, having the BusyBox program combine over two hundred programs together often saves substantial disk space and system memory.
>BusyBox benefits from the single binary approach, as it reduces the overhead introduced by the executable file format (typically ELF), and it allows code to be shared between multiple applications without requiring a library
>Sharing of the common code, along with routines written with size-optimization in mind, can make a BusyBox system much smaller than a system built with the corresponding full versions of the utilities replaced by BusyBox

But of course this is getting into an argument over coreutils, and not simply the shell

It's a great idea, but the author refuses to implement scrollback, iirc, forcing the user to use tmux or screen, negating the speed advantage.

Also, it's a terminal emulator not a shell.

>author refuses to implement scrollback
Just like St!!
I mean suckless does provide a patch, but still

I'll go with mksh because suckless suggests it. I like mksh anyways and it's 3x faster than bash

Yeah that's the funny thing. regardless of what you go with, anything's faster than bash.

Is ash that fucking good?

Actually, looking at it now, the author agreed to implement scrollback, though it hasn't happened yet.

I mean it's the fastest shell you can get if you still want basic tab completion.

HMM? count me in. Why the fuck haven't i heard about this shell

I'd say a few reasons
1. Because everyone is trained to use and implement GAHNOO stuff, and not other options
2. Because although it's blazing fast compared to bash, it conforms pretty strictly to POSIX, so scripts that make use of "bash-isms" would have to be rewritten

Is it faster than mksh?

Yes, according to the benchmark linked in the OP

okay, is it secure as well?

Hard to say. I guess they both have advantages in this regard. Bash has way more eyes on it due to being used basically everywhere in GNU/Loonix land, but on the other hand, ash is way smaller, so there's a lower attack surface. Less code to be insecure in the first place.

I'd say bash is insecure desu. I think i might switch to ash user. Thanks for the advice, i'm just confused on why suckless didn't suggest it. They only suggest mksh and dash as shells on their website.

Yeah I don't know either.

If you're a suckless-type, maybe give Alpine Linux a go. It uses busybox as the coreutils, busybox ash as the shell, and musl as libc.

That's nice and all, but how often does the shell performance actually matter? How much time is actually spent in the shell vs. in the programs it runs?

Anyone else change their PS1 in bash and when they press up to see previous sent commands it glitches out and the first couple characters are stuck? I know it's only visual and functions normally but it's super annoying.

...Do you know what a GPU is or how one works or why they are used for graphics in the first place?

bash's PS1= interpreter uses the escape codes \[ and \] to surround non-printable PS1 prompt characters, like color escapes, in order to calculate terminal width and wrapping text.

Post your $PS1

I would but they need more packages and a bigger community. Then im in. I sticking to debian

PS1='[\033[01;31m\] \w \[\033[00m\]] '

>vector
You're dumb. A GPU does Matrticies, that's all they are good for.

Good choice, although systemd sucks

try
PS1=' \[\e[1;31m\]\w\[\e[0m\] '

Thanks! It looks slightly different but it works flawlessly.

>fish
kek.

you should probably look up the bash documentation instead of copy pasting stuff if you want things to work correctly next time

I actually was looking at the documentation when I was messing with it. That config was from almost 10 years ago when I was ricing netbooks though.

It's my go-to shell for OS X and Linux, it's great.

I think i'm gonna make ksh93 my go-to now. Hadn't tried it until recently, but it's actually really good

it's in the op already, mirbsd korn shell

yep and it was included in the benchmark

bump

>fish is okay
>ssh user@ho
>*dns lookup in background*

Bash does it too. Annoying.

On what distro? On debian it only completes hosts from the config file.

> completes hosts from the config file
Oh yeah, it seems like it. it is fast, at least, but I remember it took some time to display a load of hosts on one of the hosts I manage. Can't remember the distro, it's either CentOS, Ubuntu or Debian.

It is

Where the fuck is FISH SHELL THE BEST SHELL EVER!

Holy shit Krebs stop with your fish already.

well the terminal literally is for graphics...
>no rc

KORN SHELL BEST SHELL

This
It's unironically a really badass shell

were you in the unix thread?

I created the unix thread

Nice. I wanted to answer the question about inits, but the thread was already archived.

Ah yeah. I was wondering about that

zsh
>Global Alias
>*Extendo Globs*
>"Auto-Complete on Everything"
>OMZ

None of them are even remotely close to systemd. Quite the opposite.
HP-UX has mostly standard sysvinit, with a small difference that init scripts are in /sbin/init.d because HP thought that makes more sense. It has a neat feature that during startup it logs everything to /etc/rc.log so you have logs available even before /var is mounted.
AIX is pretty close to BSD init, except it relies heavily on inittab instead of separate scripts.
Solaris uses SMF (Service Management Facility) which is mostly a wrapper around sysvinit, not unlike how runit and openRC can be used on Linux.

Interesting. So they all mostly just use sysvinit, as seen on a lot of pre-systemd loonixes. I'm not very familiar with BSD init, but I assume it's fairly similar.

also,
>Solaris uses SMF which is mostly a wrapper around sysvinit
>not unlike openRC
InstallGentoo?

>So they all mostly just use sysvinit, as seen on a lot of pre-systemd loonixes.
Interestingly, Ubuntu, Fedora, and RHEL used Upstart before switching to systemd. It's one of Lennart's (and systemd apologists') little lies to suggest that everyone was using sysvinit before systemd came around. It's convenient because people hate sysvinit a lot.

>I'm not very familiar with BSD init, but I assume it's fairly similar.
It's the original Unix init. Instead of the rcX.d directories with symlinks that sysvinit uses, BSD init has a sequencer script that determines the order of init scripts by reading their headers.
AIX is even simpler (and cruder) in that it starts most daemons directly from inittab.

>InstallGentoo?
Correct me if I'm wrong, but I think Gentoo uses openRC also as the init, instead of just being a wrapper around sysvinit.

>I'm not very familiar with BSD init
It's really easy. BSDs have rc.conf, which are text files that define shell variables, and based on which are set yes, or no, or other values, different things get started up. But you can do more than define variables, you could, if you desired to, have rc.conf be an entire shell script of its own.

they're older technology than that you know.
you don't know the connection? go learn linear algebra moron.

>GPU based terminal emulator written in Rust