Coccinelle archive mirror
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Julia Lawall <julia.lawall@inria.fr>, cocci@inria.fr
Subject: Re: [cocci] Checking the search for a repeated condition check with SmPL
Date: Mon, 19 Feb 2024 10:45:41 +0100	[thread overview]
Message-ID: <cfbd7f80-5485-4578-a77d-94445af135cd@web.de> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2402181707300.3095@hadrien>

Another contribution was published yesterday:
account for the fact that binops and assignops are now stripped

Thus data processing can be measured once more after such a bit of development progress
also together with the software combination “Coccinelle 1.1.1-00739-g68c580f1”
for the following SmPL script variants.


> Accordingly, the following semantic patch is quite slow:
>
> @@
> binary operator bo;
> constant c;
> identifier var;
> statement stmt;
> @@
> ( if (var bo c) return var;
> & stmt
> )
>  ... when != var
> - stmt

Markus_Elfring@Sonne:…/Projekte/Linux/next-analyses> git checkout next-20240209 && time spatch drivers/md/dm-vdo/slab-depot.c …/Projekte/Coccinelle/janitor/delete_redundant_if_statement3.cocci
…
real    0m16,386s
user    0m16,306s
sys     0m0,056s


> And the following semantic patch is quite fast:
>
> @@
> binary operator bo;
> constant c;
> identifier var;
> statement stmt;
> @@
> stmt
>  ... when != var
> ( if (var bo c) return var;
> &
> - stmt
> )

Markus_Elfring@Sonne:…/Projekte/Linux/next-analyses> git checkout next-20240209 && time spatch drivers/md/dm-vdo/slab-depot.c …/Projekte/Coccinelle/janitor/delete_redundant_if_statement-by_Julia-20240218.cocci
…
real    0m47,888s
user    0m47,238s
sys     0m0,304s


> In the former case, it first matches stmt at the end of the semantic
> patch, that can be anything.  In the latter case, it first matches the if,
> then binds stmt, and then can easily recognize stmt earlier in the code.
>
> There will be no changes in this respect.

Which evaluation order for the shown source code search and transformation code
(according to the semantic patch language) will become more desirable finally?

Will development interests grow to reduce the software run time differences
(according to the demonstrated application of a higher level metavariable type “statement”)
for an SmPL conjunction considerably?

Regards,
Markus

  parent reply	other threads:[~2024-02-19  9:45 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-09 15:40 [cocci] Checking the search for a repeated condition check with SmPL Markus Elfring
2024-02-11  8:24 ` Markus Elfring
2024-02-11  8:42   ` Julia Lawall
2024-02-11  9:55     ` Markus Elfring
2024-02-11 10:29       ` Julia Lawall
2024-02-15  8:18   ` Markus Elfring
2024-02-15  9:29     ` Julia Lawall
2024-02-15 10:33       ` Markus Elfring
2024-02-18  8:03         ` Markus Elfring
2024-02-18  8:11           ` Julia Lawall
2024-02-18  8:55             ` Markus Elfring
2024-02-18 16:12               ` Julia Lawall
2024-02-18 17:30                 ` Markus Elfring
2024-02-19  7:30                 ` Markus Elfring
2024-02-19  7:36                   ` Julia Lawall
2024-02-19  7:48                     ` Markus Elfring
2024-02-19  9:45                 ` Markus Elfring [this message]
2024-02-17 13:14 ` [cocci] Fixing the SmPL search for a bit of duplicate code Markus Elfring
2024-02-17 15:23   ` Julia Lawall
2024-02-17 16:38     ` Markus Elfring
2024-02-18  7:04       ` Markus Elfring
2024-02-18  7:44         ` Julia Lawall
2024-02-18 19:33       ` Markus Elfring
2024-02-18 19:43         ` Julia Lawall

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=cfbd7f80-5485-4578-a77d-94445af135cd@web.de \
    --to=markus.elfring@web.de \
    --cc=cocci@inria.fr \
    --cc=julia.lawall@inria.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 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).