You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@beehive.apache.org by Jacob Danner <ja...@gmail.com> on 2007/09/04 20:37:43 UTC

Perf fix in caching of ControlAnnotationProcessor

Hi All,
It was suggested to me by a colleague that the performance of apt and
the ControlAnnotationProcessor could be increased if caching was
enabled differently. I began to investigating caching of the
VelocityGenerator and later the ControlAnnotationProcessor. After
tinkering around, I found that performance could be increased with a
small change to the ControlAnnotationProcessorFactory to cache the
instance of the ControlAnnotationProcessor.

To test I was using Workshop for Weblogic with a webproject using the
beehive-controls facet.
some not-so-precise perf metrics show the following:
No Changes
First Build - ~30 s
Subsequent Builds - ~25s

Caching of ControlAnnotationProcessor (item4)
First Build - ~28s
Subsequent Build - ~23s


The change is fairly simple (here it is below):
public AnnotationProcessor getProcessorFor(Set<AnnotationTypeDeclaration> atds,

AnnotationProcessorEnvironment env)
    {
        if(_twoPhaseAnnotationProcessor == null)
            _twoPhaseAnnotationProcessor = new
ControlAnnotationProcessor(atds, env);

        return _twoPhaseAnnotationProcessor;
    }

    TwoPhaseAnnotationProcessor _twoPhaseAnnotationProcessor;



and I've attached a small patch in case anyone is interested in checking it out.
Thanks,
-Jacob Danner

Re: Perf fix in caching of ControlAnnotationProcessor

Posted by Xibin Zeng <xi...@gmail.com>.
Jacob -

Long time no see! How is everything? Can't believe that I have been Seattle
for over a year now. My new gig is in Belltown on 4th street.

Take care,
Xibin

On 9/4/07, Jacob Danner <ja...@gmail.com> wrote:
>
> Hi All,
> It was suggested to me by a colleague that the performance of apt and
> the ControlAnnotationProcessor could be increased if caching was
> enabled differently. I began to investigating caching of the
> VelocityGenerator and later the ControlAnnotationProcessor. After
> tinkering around, I found that performance could be increased with a
> small change to the ControlAnnotationProcessorFactory to cache the
> instance of the ControlAnnotationProcessor.
>
> To test I was using Workshop for Weblogic with a webproject using the
> beehive-controls facet.
> some not-so-precise perf metrics show the following:
> No Changes
> First Build - ~30 s
> Subsequent Builds - ~25s
>
> Caching of ControlAnnotationProcessor (item4)
> First Build - ~28s
> Subsequent Build - ~23s
>
>
> The change is fairly simple (here it is below):
> public AnnotationProcessor getProcessorFor(Set<AnnotationTypeDeclaration>
> atds,
>
> AnnotationProcessorEnvironment env)
>     {
>         if(_twoPhaseAnnotationProcessor == null)
>             _twoPhaseAnnotationProcessor = new
> ControlAnnotationProcessor(atds, env);
>
>         return _twoPhaseAnnotationProcessor;
>     }
>
>     TwoPhaseAnnotationProcessor _twoPhaseAnnotationProcessor;
>
>
>
> and I've attached a small patch in case anyone is interested in checking
> it out.
> Thanks,
> -Jacob Danner
>
>