help-bash
[Top][All Lists]
Advanced

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

Re: bash optimization away question


From: #!microsuxx
Subject: Re: bash optimization away question
Date: Sun, 3 Nov 2024 13:40:28 +0100

dunno atm what else to optimize

i had , in my thoughts , the case
a var has much content
and then code says var=$var or ${var<opts>}

i was hoping bash wouldnt re-set long data , .. cpu : faster less load

i havent benchmarked , yet

On Sun, Nov 3, 2024, 09:16 Andreas Kähäri <andreas.kahari@abc.se> wrote:

> On Sun, Nov 03, 2024 at 01:29:02AM +0100, #!microsuxx wrote:
> > is a
> >
> > var=${var:-blabla}
> >
> > optimized away to no exec at all
> > if var is not empty
> > ?
> >
> > also same for = := -
>
> There is already no exec involved in the expansion of the parameter.
>
> What do you expect to gain from optimizing this away, compared to
> optimizing something else?  Compared to actually executing an external
> command, the time spent on this is negligible.
>
> --
> Andreas (Kusalananda) Kähäri
> Uppsala, Sweden
>
> .
>


reply via email to

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