[Top][All Lists]

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

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

From: Eduardo Bustamante
Subject: Re: Should [[ -v 1 ]] be supported?
Date: Thu, 27 Dec 2018 21:56:26 -0800

On Thu, Dec 27, 2018 at 9:45 PM Peng Yu <address@hidden> 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.

reply via email to

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