shellbench
shellbench copied to clipboard
Add string manipulation benchmarks
The goal of these benchmarks is to show that using builtins for simple, common string manipulation primitives is very much (two to three orders of magnitude) faster than having to work around the lack of said builtins using external processes.
Overall, dash typically executes POSIX-compliant scripts faster than bash, and it's a good thing that e.g. Debian-derived distros use dash as /bin/sh by default; however, I've seen that bash-specific scripts using string manipulation builtins can end up being faster than POSIX-compliant scripts relying on comparatively slow sed / cut chains...