ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peter reilly <>
Subject Re: Could Ant build scripts be compiled?
Date Tue, 25 Nov 2003 18:43:49 GMT
On Tuesday 25 November 2003 17:20, Sikha, Naresh wrote:
> Most of the performance slow down I have experienced is in cloning a
> hashtable of thousands of properties for every target invocation.

This only happens when ant/antcall/subant/foreach is used for each
target invocation.

There should not be much need to do this when ant 1.6 is (finally)

  - use <macrodef> instead of <antcall>
  - use <antcontrib:for> instead of <antcontrib:foreach>
  - set subant only for different top level projects

> I had to resort to the runtarget target provided by ant-contrib which
> increases the performance of my build many times (sorry no meaningful stats
> yet). This performance increase is directly related to the fact that
> runtarget does not clone the Project model (and the hashtable it
> encapsulates) for every target invocation.

This is very true.

> Basically, executing Ant targets in the standard Ant way incurs a
> performance overhead much greater than a simple stack frame push.

Only if <antcall> etc is used, normal target dependencies do
not have this issue.

>  Judicious
> use of targets to the point of writing custom tasks to do more complex flow
> logic, greatly increases performance.

I have also noticed that using xerces xml slows down ant, for jdk 1.4, I have
moved the xercesImpl.jar  xml-apis.jar files out of $ANT_HOME/lib.

Another (smaller and more dangereous) speed up is to put -noverify in ANT_OPTS

> Hope this helps.
> -Naresh Sikha
> -----Original Message-----
> From: Johnny Tolliver []
> Sent: Tuesday, November 25, 2003 9:09 AM
> To: Ant Users List
> Subject: RE: Could Ant build scripts be compiled?
> As an incomplete 'make' convert, one of the common complaints I hear is
> that Ant is slow. And indeed it is. If much of that slowness is indeed in
> the XML parsing, then compiled scripts could be a godsend. If much of it is
> in, say, javac dependency analysis, then compilation might not help.
> Perhaps someone in
> the know should do some kind of profiling to see just where the bottlenecks
> are.
> Johnny S. Tolliver
> Oak Ridge National Laboratory
>, 865-574-1305
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message