All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: Hauke Mehrtens <hauke@hauke-m.de>,
	"backports@vger.kernel.org" <backports@vger.kernel.org>,
	cocci@systeme.lip6.fr
Subject: Re: [Cocci] 0079-netdev-destructor.cocci very slow
Date: Wed, 19 Sep 2018 11:02:09 +0200	[thread overview]
Message-ID: <1537347729.10305.10.camel@sipsolutions.net> (raw)
In-Reply-To: <alpine.DEB.2.20.1809191047200.4106@hadrien>

On Wed, 2018-09-19 at 10:49 +0200, Julia Lawall wrote:

> > > It looks like coccinelle already does such a grep when I remove the <--
> > > --> from the patch, because this is about 100 times faster.
> > 
> > Good point, not sure why it doesn't do that with the <... ...>?
> 
> Because <... ...> means 0 or more of what is inside.

Oops, right.

> <+... ...+> looks for one or more and may be faster.

Indeed, it's two orders of magnitude faster (running it on just
drivers/net/wireless goes from ~500 to ~2s for me) as it can throw away
almost all files immediately.

> On the other hand, it ensures that
> there is one or more, which can also be expensive.

That doesn't really matter all that much for us - the (really) expensive
part is running it on all files that don't even contain it at all.

> It could be better to just have a rule:
> 
> @worthwhile@
> @@
> 
> (
> functions(...)
> > 
> 
> you(...)
> > 
> 
> like(...)
> )
> 
> and then have the <... ...> rule depend on worthwhile.

Good idea too.

Thanks!

johannes
--
To unsubscribe from this list: send the line "unsubscribe backports" in

WARNING: multiple messages have this Message-ID (diff)
From: johannes@sipsolutions.net (Johannes Berg)
To: cocci@systeme.lip6.fr
Subject: [Cocci] 0079-netdev-destructor.cocci very slow
Date: Wed, 19 Sep 2018 11:02:09 +0200	[thread overview]
Message-ID: <1537347729.10305.10.camel@sipsolutions.net> (raw)
In-Reply-To: <alpine.DEB.2.20.1809191047200.4106@hadrien>

On Wed, 2018-09-19 at 10:49 +0200, Julia Lawall wrote:

> > > It looks like coccinelle already does such a grep when I remove the <--
> > > --> from the patch, because this is about 100 times faster.
> > 
> > Good point, not sure why it doesn't do that with the <... ...>?
> 
> Because <... ...> means 0 or more of what is inside.

Oops, right.

> <+... ...+> looks for one or more and may be faster.

Indeed, it's two orders of magnitude faster (running it on just
drivers/net/wireless goes from ~500 to ~2s for me) as it can throw away
almost all files immediately.

> On the other hand, it ensures that
> there is one or more, which can also be expensive.

That doesn't really matter all that much for us - the (really) expensive
part is running it on all files that don't even contain it at all.

> It could be better to just have a rule:
> 
> @worthwhile@
> @@
> 
> (
> functions(...)
> > 
> 
> you(...)
> > 
> 
> like(...)
> )
> 
> and then have the <... ...> rule depend on worthwhile.

Good idea too.

Thanks!

johannes

  reply	other threads:[~2018-09-19 14:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-17 21:55 0079-netdev-destructor.cocci very slow Hauke Mehrtens
2018-09-17 21:55 ` [Cocci] " Hauke Mehrtens
2018-09-18  9:22 ` Johannes Berg
2018-09-18  9:22   ` [Cocci] " Johannes Berg
2018-09-18 21:52   ` Hauke Mehrtens
2018-09-18 21:52     ` [Cocci] " Hauke Mehrtens
2018-09-19  8:43     ` Johannes Berg
2018-09-19  8:43       ` [Cocci] " Johannes Berg
2018-09-19  8:49       ` Julia Lawall
2018-09-19  8:49         ` Julia Lawall
2018-09-19  9:02         ` Johannes Berg [this message]
2018-09-19  9:02           ` Johannes Berg

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=1537347729.10305.10.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=backports@vger.kernel.org \
    --cc=cocci@systeme.lip6.fr \
    --cc=hauke@hauke-m.de \
    --cc=julia.lawall@lip6.fr \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.