beehive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacob Danner" <>
Subject Perf fix in caching of ControlAnnotationProcessor
Date Tue, 04 Sep 2007 18:37:43 GMT
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.
-Jacob Danner

View raw message