<div dir="ltr">On 4 August 2017 at 19:57,  <span dir="ltr">&lt;<a href="mailto:leonardo.sandoval.gonzalez@linux.intel.com" target="_blank">leonardo.sandoval.gonzalez@linux.intel.com</a>&gt;</span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">+        i_sigfile, max_sigfiles_to_compare = 0, 20<br>
         for k in files1.keys() | files2.keys():<br>
             if k in files1 and k in files2:<br>
+                i_sigfile += 1<br>
                 print(&quot;%s differs:&quot; % k)<br>
+                # this is an expensive computation, thus just compare the first<br>
+                # &#39;max_sigfiles_to_compare&#39; k files<br>
+                if i_sigfile &gt; max_sigfiles_to_compare:<br>
+                    continue<br>
                 sigdatafile1 = self.topdir + &quot;/tmp-sstatesamehash/stamps/&quot; + k + &quot;.&quot; + files1[k]<br>
                 sigdatafile2 = self.topdir + &quot;/tmp-sstatesamehash2/stamps/&quot; + k + &quot;.&quot; + files2[k]<br>
                 output = bb.siggen.compare_sigfiles(<wbr>sigdatafile1, sigdatafile2)<br></blockquote><div><br></div><div>A neater way to do this:</div><div><br></div><div>-for k in files1.keys() | files2.keys():</div>+for k in list(files1.keys() | files2.key())[:20];</div><div class="gmail_quote"><br></div><div class="gmail_quote">(take the union of the files1 and files2 keys, turn it into a list, and slice off up to the first 20)</div><div class="gmail_quote"><br></div><div class="gmail_quote">Ross</div></div></div>