Re: [PATCH] validate_failures.py: Fix performance regression

2013-02-06 Thread Bernhard Reutner-Fischer
On Fri, Dec 07, 2012 at 10:31:57AM -0500, Diego Novillo wrote: >On Thu, Dec 6, 2012 at 1:12 PM, Bernhard Reutner-Fischer > wrote: > >> def IsComment(line): >>"""Return True if line is a comment.""" >> - return line.startswith('#') >> + return bool(re.matches("#", line)) > >startswith() is a

Re: [PATCH] validate_failures.py: Fix performance regression

2012-12-17 Thread Diego Novillo
On Thu, Dec 13, 2012 at 10:12 AM, Bernhard Reutner-Fischer wrote: > On Fri, Dec 07, 2012 at 10:31:57AM -0500, Diego Novillo wrote: >>On Thu, Dec 6, 2012 at 1:12 PM, Bernhard Reutner-Fischer >> wrote: > > @@ -210,12 +211,12 @@ def IsInterestingResult(line): >if '|' in line: > (_, line) = l

Re: [PATCH] validate_failures.py: Fix performance regression

2012-12-13 Thread Bernhard Reutner-Fischer
On Fri, Dec 07, 2012 at 10:31:57AM -0500, Diego Novillo wrote: >On Thu, Dec 6, 2012 at 1:12 PM, Bernhard Reutner-Fischer > wrote: @@ -210,12 +211,12 @@ def IsInterestingResult(line): if '|' in line: (_, line) = line.split('|', 1) line = line.strip() - return any(line.startswith(resul

Re: [PATCH] validate_failures.py: Fix performance regression

2012-12-07 Thread Diego Novillo
On Thu, Dec 6, 2012 at 1:12 PM, Bernhard Reutner-Fischer wrote: > def IsComment(line): >"""Return True if line is a comment.""" > - return line.startswith('#') > + return bool(re.matches("#", line)) startswith() is a better match here. > def IsInclude(line): >"""Return True if line