[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] m4sh: prefer bash over sh

From: Zack Weinberg
Subject: Re: [PATCH] m4sh: prefer bash over sh
Date: Mon, 23 Mar 2020 11:12:07 -0400

On Mon, Mar 23, 2020 at 9:34 AM Ross Burton <address@hidden> wrote:
> _AS_DETECT_BETTER_SHELL looks for a good shell to use, and tries to look for
> 'sh' before 'bash'.  Whilst for many systems sh is a symlink to bash,
> there are many where sh is a symlink to a more minimal sh implementation.
> For example, Debian by default has /bin/sh -> /bin/dash: dash is a faster
> shell to start (which makes a notable difference to boot speed) but is not
> as fast as bash at executing long scripts (and configure scripts are not
> known for their conciseness).

Ignoring what I just said in the other thread, a patch like this would
be a lot more compelling if it came with some performance
measurements.  Do you have time to find out whether bash is, in fact,
faster at executing long configure scripts than dash?  I would suggest
measuring it like this: find a bunch of configure scripts of varying
lengths (the minimal configure script with autoconf 2.69 is 2800 lines
long, and the GCC source tree contains 35 different configure scripts
of lengths ranging from 4000 to 83,000 lines, so that might be a good
start, but it'd be nice to have at least one short and one long script
written by a different set of developers too).  Run each one under
'time', 11 times in a row, with both bash and dash.  Throw out the
numbers for the very first run with each shell, and send us a CSV file
containing the reported wall, user, and system times and the name *and
the line count* for all the other runs of each script with each shell.
If you feel like doing statistics on those numbers, go for it, but I
can do it if you'd rather not.  If you have access to more than one
CPU architecture (as physical hardware) that would also be an
interesting independent variable.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]