ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ninju Bohra <>
Subject Re: ant-contrib foreach performance
Date Tue, 13 Dec 2005 19:42:04 GMT
Try using the <for> task.  The <foreach> task has the overhead of having to re-load
the build file as it runs the target.
The <for> task uses macrodefs and should be much faster.
Also if you have such a well-defined complex usage it may make sense to create a custom task
and drop into a compiled language (like JAVA) to accomplish what you need.

----- Original Message ----
From: Ephi Sachs <>
Sent: Tuesday, December 13, 2005 11:53:41 AM
Subject: ant-contrib foreach performance

I have a <foreach> task which runs on a list of >1000 strings, and calls
an ant task which extracts 2 sub-strings, interprets them as numbers,
calculates their sum, and replaces the 2 sub-strings with their sum
(this is done by writing the sub-strings to a properties file, loading
it and using the <math> task).
The problem is that running the <foreach> task so many times, even on an
empty task which doesn't do anything, takes a long time (over a minute).
1) Is there a more efficient way to accomplish iteration over a list?
2) Is there a way to perform such a math operation in a regular regex
replacement, without using a foreach iteration?


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

View raw message