Re: [Codenarc-developer] performance improvements in rules
Brought to you by:
chrismair
From: Hamlet D. <ham...@ca...> - 2011-05-02 06:09:00
|
Rewriting the AbstractAstVisitor class in Java would probably be an easy way to see perf improvements as well. I don't think there is much in the class that is Groovy-dependent. ----- Original Message ----- > 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 > > > ------------------------------------------------------------------------------ > Benefiting from Server Virtualization: Beyond Initial Workload > Consolidation -- Increasing the use of server virtualization is a top > priority.Virtualization can reduce costs, simplify management, and > improve > application availability and disaster protection. Learn more about > boosting > the value of server virtualization. > http://p.sf.net/sfu/vmware-sfdev2dev > _______________________________________________ > Codenarc-developer mailing list > Cod...@li... > https://lists.sourceforge.net/lists/listinfo/codenarc-developer > |