[poky] About the operator "??="

Richard Purdie rpurdie at linux.intel.com
Wed Dec 8 02:30:22 PST 2010


Hi Dongxiao,

On Wed, 2010-12-01 at 09:57 +0800, Xu, Dongxiao wrote:
> Recently when investigating the file parsing speed, I found the
> implementation of "??=" is another hot spot. This operator will not
> apply the default assignment until the end of the parse, which is
> different from "?=". According to current poky, the users for "??=" is
> mostly the scm revisions stored in poky-default-revisions.inc.
> 
> Currently the final assignment logic for "??=" is added in finalize(),
> which costs about 20% parsing time.

Can I take a look at the graph showing that? I'm a little surprised it
takes 20% of the time, that is a rather scary amount!

> The differences between "??=" and "?=" are straight forward, however I
> don't fully understand in which senario the "??=" should be used. Or
> in other word, why those scm revisions should use "??=". Could you
> help to clarify a bit? Thanks so much!

You would use ??= when you are assigning a value but you want any other
definition anywhere to be able to override it regardless of
include/inherit ordering constraints.

We created the operator to solve some problems we had with the SRCREV
variables and its use hasn't grown into other areas but there is no
reason it shouldn't be used in other places, it probably just didn't
exist when other code was written.

> BTW, I noticed that openembedded doesn't use this operator.

Their loss ;-)

Cheers,

Richard




More information about the poky mailing list