Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
To: "Burton, Ross" <ross.burton@intel.com>
Cc: OE-core <openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH 2/2] sstatetests: limit the number of signature comparisons when differ
Date: Mon, 07 Aug 2017 12:06:12 -0500	[thread overview]
Message-ID: <1502125572.2330.3.camel@linux.intel.com> (raw)
In-Reply-To: <CAJTo0LY5mBjm586rFqHBofcZE3eSzY=kAaxp2P=4PBA-2nYwiA@mail.gmail.com>

On Mon, 2017-08-07 at 17:32 +0100, Burton, Ross wrote:
> On 4 August 2017 at 19:57,
> <leonardo.sandoval.gonzalez@linux.intel.com> wrote:
>         +        i_sigfile, max_sigfiles_to_compare = 0, 20
>                  for k in files1.keys() | files2.keys():
>                      if k in files1 and k in files2:
>         +                i_sigfile += 1
>                          print("%s differs:" % k)
>         +                # this is an expensive computation, thus just
>         compare the first
>         +                # 'max_sigfiles_to_compare' k files
>         +                if i_sigfile > max_sigfiles_to_compare:
>         +                    continue
>                          sigdatafile1 = self.topdir +
>         "/tmp-sstatesamehash/stamps/" + k + "." + files1[k]
>                          sigdatafile2 = self.topdir +
>         "/tmp-sstatesamehash2/stamps/" + k + "." + files2[k]
>                          output =
>         bb.siggen.compare_sigfiles(sigdatafile1, sigdatafile2)
> 
> 
> A neater way to do this:
> 
> 
> -for k in files1.keys() | files2.keys():
> +for k in list(files1.keys() | files2.key())[:20];
> 
> 
yes, but we this way, we are not listing those > 20 and I believe this
is important. This fix just diffsigs the first 20, and the rest are just
listed for convenience.

also, sets are not 'subscriptable' thus slicing is not possible on sets.

Leo



> (take the union of the files1 and files2 keys, turn it into a list,
> and slice off up to the first 20)
> 
> 
> Ross




  reply	other threads:[~2017-08-07 16:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-04 18:57 [PATCH 1/2] sstatetests: Use python function instead of bitbake-diffsigs script leonardo.sandoval.gonzalez
2017-08-04 18:57 ` [PATCH 2/2] sstatetests: limit the number of signature comparisons when differ leonardo.sandoval.gonzalez
2017-08-07 16:32   ` Burton, Ross
2017-08-07 17:06     ` Leonardo Sandoval [this message]
2017-08-07 17:05       ` Burton, Ross
2017-08-07 17:19         ` Leonardo Sandoval

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1502125572.2330.3.camel@linux.intel.com \
    --to=leonardo.sandoval.gonzalez@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=ross.burton@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox