From mboxrd@z Thu Jan 1 00:00:00 1970 From: johannes@sipsolutions.net (Johannes Berg) Date: Wed, 19 Sep 2018 11:02:09 +0200 Subject: [Cocci] 0079-netdev-destructor.cocci very slow In-Reply-To: References: <1537262543.2957.19.camel@sipsolutions.net> <1537346626.10305.2.camel@sipsolutions.net> Message-ID: <1537347729.10305.10.camel@sipsolutions.net> To: cocci@systeme.lip6.fr List-Id: cocci@systeme.lip6.fr 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