*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:

deftly.net/posts/2017-05-01-openbsd-ksh-tab-complete.html
oilshell.org/
twitter.com/NSFWRedditVideo

If your shell's performance matters you've probably fucked up and shouldn't be using a shell in the first place.

It matters because autism

>>>/facebook/

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.

Never write shellscript.

Said no one ever

You realize that is not ksh doing that but an argument of `ls` that ksh's default conf file probably aliases `ls` to, right?

Actually it is ksh because I re-aliased it to ls --color=auto and it still does this.

So ksh fucks with the default output of programs? You know what I call that? (((BLOAT)))

the fuck are you talking about?
this is just how ksh does its tab completion
according to the benchmark the entire thread is based on, ksh is still faster than almost all other shells, even mksh

Everyone after the '90s had learned to avoid it and switched to languages like perl and python. I don't know why your generation suddenly thought it was cool again. It was the original cancer in Linux.

wtf, literally one of the smaller shells. I think dash is a little smaller, but it's still extremely small.
deftly.net/posts/2017-05-01-openbsd-ksh-tab-complete.html

Aw shit! Now I have to come up with some shell benchmarks because I have a joke project coming up were shell performance could actually matter.

Dash I think is way smaller. Its whole point is to make system shell scripts run super fast and light. I don't even know if you can get tab-completion for it.
(if that is possible somehow and i'm just a brainlet, I would totally check it out though)

Steve Jobs put it in his gay OS

/bin/sh is in POSIX, and shit like Perl and Python aren't. That's why they matter. You'd know this if you did any real sysadmin work ever, and not just diddle underage Linux distros.

owo?

real sysadmin here.
10k+ servers.
Perl and Python (and worse stuff) is on literally every one of them. Perl and Python are what we use instead of sh for anything beyond the tiniest and simplest of scripts. POSIX? who cares? We have CentOS and a lot of default stuff. If you're going to cut deeper than that you may as well work with a unikernel instead.

I switched to dash because of this thread. Thanks OP.

Dash doesn't have tab completion. Just keep bash on your system so you can switch to it if you forget a command or need to use bash only scripts.

Just because you do it that way doesn't make it the right way or best way. Some might only want performance say a dash shell over cross-platform say two million perl scripts and system dependencies thereby increasing disk bloat and proccessing bloat/time, but I don't know how perl translates commands to assembly so I couldn't speak about that.

Get out now.

Perl and python have use cases in cross-platform work you faggot.

You're welcome! Glad I could help!
For an interactive shell, this is a dealbreaker for me. I'll be using either ksh93 or busybox ash.
You cant make me!

I looked into it, appears to be about 25% smaller as far as sloc goes. Pretty impressive, but like you mentioned lacking some features.
Just a note, everyone should keep a eye on oil shell, it's still in development but making some serious gains and might very well one day be able to compete with the best.
oilshell.org/

>(((dreamhost.com)))

Fish works nice enough for me. Sensible defaults and very little work to configure.

Just came to post about fish and you beat me.

Hello time-travelling '90s dude. Welcome to the future where the UNIX wars have ended with several free *NIXs running the show and "Linux compatible" has replaced "POSIX". You no longer have to worry about SunOS 4's fucked up awk or HP/UX's fucked up everything! Even Windows now supports a Linux compatible API, and you can cross-compile to Mac with almost no effort. You can even run your OS/360 stuff under Hercules!

dash is still dog slow and as most non-trivial scripts are filled with gnuisms it requires a heavy amount of porting to work with it. I'd recommend spending that effort on a python conversion instead as you'll have the same issues with binary data, error handling, process management, etc. in dash.

Deprecated by busybox hush.

?
Are they replacing the shell again?

Everybody uses "POSIX" as *BSD/Linux(glibc) nowadays, though.

It's just their smallest bourne compatible shell.

It shows it after you press TAB, not ENTER. At this point ls didn't run yet.

This. Worrying about shell performance is like worrying about the strength of duct tape: if it really matters then you are using the wrong tool.

zsh with grml-zshrc here. Literally best. oh-my-zsh is cancer.

Ksh93 is under a better license too.

assuming you're not a troll Why exactly? I use shell scripts a lot for maintenance, administration, backups, etc. Is there really that good of a reason to switch when everything just works?

Not everything works, though. It's extremely easy to write shell scripts that fail in edge cases.
Do all your shell scripts survive encounters with filenames with a leading dash?

That's easy to solve, though. Anyway Perl (arguably an awk replacement) and Python can't replace the shell; they're not supposed to be the token-based executable glue language that sh is.
Now, you could make a really good shell, but you'll have to make big amends to POSIX (\0 instead of \n as a delimiter EVERYWHERE).