public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
To: Diego Novillo <dnovillo@google.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] validate_failures.py: Fix performance regression
Date: Thu, 13 Dec 2012 15:12:00 -0000	[thread overview]
Message-ID: <20121213151219.GB19295@mx.loc> (raw)
In-Reply-To: <CAD_=9DSbFoRPesGKf4m+1j-7zTdH4mzxHwBWw+AYcdh1ocxcMg@mail.gmail.com>

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
><rep.dot.nop@gmail.com> wrote:

@@ -210,12 +211,12 @@ def IsInterestingResult(line):
   if '|' in line:
     (_, line) = line.split('|', 1)
     line = line.strip()
-  return any(line.startswith(result) for result in _VALID_TEST_RESULTS)
+  return bool(_VALID_TEST_RESULTS_REX.match(line))

I wonder why we care about '|' at all? Can you give an example where
this is of relevance?

Just asking because IIUC you throw away the beginning of the line until
the first pipe and try to match the remainder. Did you mean to do this
the other way round, throwing away the pipe and remainder instead?

I suspect that this function should just be
def IsInterestingResult(line):
  """Return True if line is one of the summary lines we care about."""
  return bool(_VALID_TEST_RESULTS_REX.match(line))

or, if there ever is a pipe in an interesting result
def IsInterestingResult(line):
  """Return True if line is one of the summary lines we care about."""
  if bool(_VALID_TEST_RESULTS_REX.match(line)):
    if '|' in line:
      (line, _) = line.split('|', 1)
      line = line.strip()
    return True
  return False

>
>>  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 is an include of another file."""
>> -  return line.startswith("@include ")
>> +  return bool(re.matches("@include ", line))
>
>Likewise.
>
>>  def IsNegativeResult(line):
>>    """Return True if line should be removed from the expected results."""
>> -  return line.startswith("@remove ")
>> +  return bool(re.matches("@remove ", line))
>
>Likewise.

I dropped these 3.

TIA for clarification,
>
>
>OK with those changes.
>
>
>Diego.

  reply	other threads:[~2012-12-13 15:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-04  9:24 [PATCH] validate_failures.py: also ignore .git Bernhard Reutner-Fischer
2012-12-04 13:54 ` Diego Novillo
2012-12-05  7:35   ` Bernhard Reutner-Fischer
2012-12-06 18:12     ` [PATCH] validate_failures.py: Fix performance regression Bernhard Reutner-Fischer
2012-12-07 15:32       ` Diego Novillo
2012-12-13 15:12         ` Bernhard Reutner-Fischer [this message]
2012-12-17 15:09           ` Diego Novillo
2013-02-06 16:56         ` Bernhard Reutner-Fischer

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=20121213151219.GB19295@mx.loc \
    --to=rep.dot.nop@gmail.com \
    --cc=dnovillo@google.com \
    --cc=gcc-patches@gcc.gnu.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).