[Cocci] spatch slow on many "case" statements
julia at diku.dk
Thu Mar 11 12:46:49 CET 2010
On Thu, 11 Mar 2010, Peter Tummeltshammer wrote:
> I recently started using your tool and noticed, that the execution time of
> spatch increases significantly with the number of case statements in the
> c-file. I use a very simple patch on a c-file containing ~70 (partially
> nested) case statements which results in a runtime of spatch of ~10 minutes on
> a 3 Ghz Pentium4 machine.
> Is there any way to speed this up? The patch only removes a specific line ten
> times in the file.
Could you send me the semantic patch you are trying to apply and the
offending file? Coccinelle is following control-flow paths, so if your
pattern contains a ... that matches a complex switch, it will be
considering each path through the switch separately, which could take
time. On the other hand, perhaps there is some way to write the semantic
patch to avoid the problem. Or perhaps there is something we can improve
in the implementation.
More information about the Cocci