Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14987

Re: Should [[ -v 1 ]] be supported?

Path csiph.com!goblin3!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail
From Eduardo Bustamante <dualbus@gmail.com>
Newsgroups gnu.bash.bug
Subject Re: Should [[ -v 1 ]] be supported?
Date Thu, 27 Dec 2018 21:56:26 -0800
Lines 32
Approved bug-bash@gnu.org
Message-ID <mailman.6443.1545977330.1284.bug-bash@gnu.org> (permalink)
References <CABrM6wmrn2gi8_HgmRg67B5nsgGNFRn8Bn-r20MvC-_2LJHZ0g@mail.gmail.com> <5dac2cf2-2fac-0fd1-058f-6a84a3271738@case.edu> <abd86dbc-f6e2-62bd-e9dc-f959e2dbff9f@inlv.org> <CABrM6wkGwVbPdrXTetVsFCiwDPg5JnK4KRh49WqACsKhrrMMdA@mail.gmail.com> <20181228013623.mersdxbzy64dpldp@crack.deadbeast.net> <CABrM6w=2zrjmV24VAgzioAu2iNcyuf3tsi--cfvkCH6MJ7feRA@mail.gmail.com> <20181228015710.tzzbejk36fsgr5wb@crack.deadbeast.net> <CABrM6wkfvTzY5UBMDz_kNr=imV_KpSsFF6o8fV5RLrKMYrPKgg@mail.gmail.com>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset="UTF-8"
X-Trace usenet.stanford.edu 1545977330 21933 208.118.235.17 (28 Dec 2018 06:08:50 GMT)
X-Complaints-To action@cs.stanford.edu
Cc g.branden.robinson@gmail.com, bug-bash <bug-bash@gnu.org>
To Peng Yu <pengyu.ut@gmail.com>
Envelope-to bug-bash@gnu.org
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=E/8Es9Gy31fxAQOzOXus/6l+jxukCa4AdBW7O1iJw54=; b=rIGFBsZF/5J9Yi+Jq5xuE4P3osS2ws98yNhgeCYN5LaUsywpcf5UHUKX9eCynlo9zd af14wISCGgO3bZGgOZwZlEEKfHgoyEbMnvAFU9v2cYp7uhbVvYphbvbb6CkuCmZc6G/X S3OY1MqqXj+V21+YDosH0mg9Ib3Sx/3/Fp5SkjN2x1FI4zmBbQAz43m1/4fMmaI01aii vtaNWUV8P0FTCFWMLP4e6GoYq8/nrCOJ0oo0C+JG5A3Rx4NHoSscUO7TUKrrkb6j5Mcg +nj2up2jbH7A3ygx1lD+BNh1DUyOxMR7B3hxi4KTnBdjA2hdoiRuZRfTV1dC+1J4PQh6 tZIw==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=E/8Es9Gy31fxAQOzOXus/6l+jxukCa4AdBW7O1iJw54=; b=Gcmasn3sR5pbPlHdibYiecqeP5bEib2362KB24UIuD0VL4hSVxiOY1DmjWqim8KS/T KNc9AzHRv09rxmO+LRonOf61T39s7bqWeGvrkr/EvXAFVamB6HLH1PKI3ORgU3SsFLVX UfnlPYJS1XkqudPB73hg8J7jjNZ/L+gMc4PN/oodDSRmPyhU7si3bMM6a/t67aweegpn mC8mquOxopH+eB0VFk4S3QF/+8FXhgg9jFOAzvBp3wQ4TDN8ADyyPJT2iLOmUB1nnoy1 3v36bW6z9TLYnzG1zhL52Xe1cDumJyQN/3sXQYQz5NO5BApGf4+/WBTJ2yHp0cmiZ/lw tN+A==
X-Gm-Message-State AJcUukdV3BNcxllJuaxj/G3xeIMQjnxUq4k/j8gLUU8LSAINoMwB9Jd0 WyOCiil0amtZPpG6LHC9axjdkM0tkGLUjsoPZFU=
X-Google-Smtp-Source AFSGD/WRGJmx3fSJtsvUxT1mA/ljx+OUaHcNLAhQj1lb301poEsKL9RvhyXFYqVBho+FqXjQM9Gs86FzauM5PfzPXyI=
X-Received by 2002:a2e:2f15:: with SMTP id v21-v6mr15300683ljv.56.1545976600916; Thu, 27 Dec 2018 21:56:40 -0800 (PST)
In-Reply-To <CABrM6wkfvTzY5UBMDz_kNr=imV_KpSsFF6o8fV5RLrKMYrPKgg@mail.gmail.com>
X-detected-operating-system by eggs.gnu.org: Genre and OS details not recognized.
X-Received-From 2a00:1450:4864:20::243
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.21
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <http://lists.gnu.org/archive/html/bug-bash/>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
Xref csiph.com gnu.bash.bug:14987

Show key headers only | View raw


On Thu, Dec 27, 2018 at 9:45 PM Peng Yu <pengyu.ut@gmail.com> wrote:
(...)
> Yes and no. For a particular bash script, you can quantify which bash
> features are the most time-consuming.
(...)
> (...) But you can not profile all the
> bash scripts that have ever been written. Since there are only limited
> features in bash, in this case, a logical way to go is to at least
> profile each commonly used feature with minimal code (as just for and
> repetitive calling that features as I do) and understand its pros and
> cons.

Err, where did you get this profiling advice from? :) It's not great.

You're just picking arbitrary expressions from a script w/o
understanding how they contribute in terms of % of time spent by your
program, then assume that tuning that is going to produce
*significant* benefits. Furthermore, your testing/measuring is not
really systematic, so the numbers you get aren't really meaningful
(are they specific to your system? or to the way you compiled bash?
are you taking caching and system load into consideration?
variability? etc.)

> (...) A profiler is an overkill in this case.

A profiler is exactly what you need here. You should profile your
script and understand the stuff that actually matters for your goals.
Otherwise you're just chasing unimportant things.

Honestly, if you're not willing to provide more context as to why
these areas should be optimized, then I'm just wasting my time here.

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: Should [[ -v 1 ]] be supported? Eduardo Bustamante <dualbus@gmail.com> - 2018-12-27 21:56 -0800

csiph-web