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


Groups > gnu.bash.bug > #16000

Re: performance bug of [[ $x ]]

From Peng Yu <pengyu.ut@gmail.com>
Newsgroups gnu.bash.bug
Subject Re: performance bug of [[ $x ]]
Date 2020-03-07 18:33 -0600
Message-ID <mailman.2269.1583627604.2412.bug-bash@gnu.org> (permalink)
References <CABrM6w=ignEwgynRTYYbBLUNs=KVhE8WCf9h=kkgHj00QNoqmw@mail.gmail.com> <20200307225816.GA997327@chrisdown.name> <CABrM6w=f1bqMekCcfSdzYGrMVFTzpWFniFKhspfBqdfyDxn1hQ@mail.gmail.com>

Show all headers | View raw


Could you show me how you do the profiling for this specific case?
Based on what proof that you can conclude that it is not the `[[`
performance problem?

On 3/7/20, Chris Down <chris@chrisdown.name> wrote:
> Peng Yu writes:
>>[[ $x ]] just tests whether the variable $x is of length 0 or not. So
>>its performance should not depend on how long the variable is.
>
> Who said it has anything to do with the [[ builtin's performance? A shell
> does
> a lot more than just running one command.
>
> For this and the last issue you posted, you could quite trivially find out
> the
> answer yourself using `perf` or another profiler.
>


-- 
Regards,
Peng

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


Thread

Re: performance bug of [[ $x ]] Peng Yu <pengyu.ut@gmail.com> - 2020-03-07 18:33 -0600

csiph-web