Re: [Codenarc-developer] performance improvements in rules
Brought to you by:
chrismair
From: Christopher M. <chr...@ea...> - 2011-04-17 02:36:21
|
Hamlet, I have been having similar thoughts myself. One of things I have been considering for the past year or so was adding in some (optional) instrumentation to get metrics on rule and overall analysis performance. But in any case, yes, I am concerned about the performance in general. And right now I have no concrete way to measure other than wall clock time. And, probably not a coincidence, it occurred to me as well that we are walking the AST tree for each rule and there has to be a lot of redundancy there. I was wondering about the feasibility and benefit (if any) of approaching the analysis from the other direction from how it currently works. Perhaps something like having each rule "register" with the different aspects of the AST and just walking it once, firing each rule component as necessary. But that was just vague "I wonder if..." kind of speculation. And that would involve a pretty significant redesign of the analysis engine and the rule framework. I have no objection to your idea. If that approach works, I guess we could expand that to other rule types as well. Chris -----Original Message----- >From: Hamlet D'Arcy <ham...@gm...> >Sent: Apr 16, 2011 1:04 PM >To: Cod...@li... >Subject: [Codenarc-developer] performance improvements in rules > >Hi Chris, > >In my opinion, the rules need some performance improvements. Do you >feel the same? > >One idea I have is to optimize rules that override >visitMethodCallExpression. We walk the AST for every rule, but many >rules only override visitMethodCall. Why not walk the tree only one >time, and then call all the rules when a method call is found? I am >thinking of an abstract class the defines only visitMethodCall as a >abstract method. Then somehow the rule runner is smart enough to >collect all the instance of the abstract classes and walk the tree >only once, calling each child rule when a MethodCallExpression is >found. It needs to support @SuppressWarnings as well. > >I think this would be an improvement. What do you think? > >What are you using to measure performance? > >Also, great activity recently :) I hope to find a little more time for >rules over the next month or so. > >-- >Hamlet D'Arcy >ham...@gm... >_______________________________________________ >Codenarc-developer mailing list >Cod...@li... >https://lists.sourceforge.net/lists/listinfo/codenarc-developer |