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.
 
Ninju
 


----- Original Message ----
From: Ephi Sachs <[EMAIL PROTECTED]>
To: user@ant.apache.org
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).
So:
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?

Thanks,
Ephi

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to