[OE-core] [PATCH 3/3] classes/buildstats: don't expand variable pointing to SystemStats
Paul Eggleton
paul.eggleton at linux.intel.com
Mon Jan 9 01:50:38 UTC 2017
Hi Patrick,
On Wed, 04 Jan 2017 14:05:03 Patrick Ohly wrote:
> On Thu, 2016-12-22 at 16:13 +1300, Paul Eggleton wrote:
> > We're placing an object into the datastore - it's very definitely not
> > something we want to be expanding.
>
> Why does it matter? Is it faster to tell getVar() that expansion isn't
> necessary?
>
> I'm fine with the change, I'm just trying to understand whether this
> merely cosmetic or has some real impact.
It will be very slightly faster if we say expand=False since the preamble to
the expansion code won't be run - though I doubt the speed difference is
actually significant outside of a tight loop. There is a guard to prevent
actually doing the expansion on a non-string value though so expanding it
doesn't do any actual harm (and having that guard is a good thing since it
saves us pain if we want to write code to get the expanded value of any
variable).
However, to my mind the patch is more about correctness - in this case we know
for sure that the value isn't a string, so we should avoid trying to expand
it.
Cheers,
Paul
--
Paul Eggleton
Intel Open Source Technology Centre
More information about the Openembedded-core
mailing list