https://issues.apache.org/bugzilla/show_bug.cgi?id=48961
Summary: Performance problem with Ant 1.8.0 in conjunction with
the Ant-Contrib "variable" task
Product: Ant
Version: 1.8.0
Platform: PC
OS/Version: Linux
Status: NEW
Severity: regression
Priority: P2
Component: Core
AssignedTo: [email protected]
ReportedBy: [email protected]
Created an attachment (id=25165)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=25165)
Ant and Ant-Contrib Performance Leak debugging script
There is a regression from Ant 1.7.1 to Ant 1.8.0 regarding performance. The
Ant-Contrib "variable" task has slowed down significantly with the new Ant
version. I wrote a little demonstration script, see the attached file
"AntDebug.zip".
The story goes as this: I have a for loop (also from Ant-Contrib), that loops
over a path-like structure. Inside the for loop I use the "variable" task from
Ant-Contrib (<var name="testvar" value="..." />) to append a string (built of
the iteration element) to a variable. So this variable grows with each
iteration.
I assume this is a pure in-memory operation. With Ant 1.7.1, it is blazing
fast, as you could expect. With Ant 1.8.0, the performance is worse. Moreover,
each single iteration is a bit slower than the previous one, so in total the
performance degrades exponentially in the number of elements. You can also
observe that it takes longer if the iteration elements are longer strings.
If you comment out the "variable" task, the for loop runs equally fast with
both Ant versions.
You can play around with the attached demonstration script. On my machine, it
takes 8 seconds if the basedir is /tmp/AntDebug, and 16 seconds if the basedir
is somewhere much deeper in the filesystem. With Ant 1.7.1, in both locations
it takes 0 seconds (I think it's somewhat below 500ms, which in turn is rounded
down).
Also see the companion mail thread on the ant-user mailing list:
http://mail-archives.apache.org/mod_mbox/ant-user/201003.mbox/%3cof85426667.e1376d33-onc12576ee.003ddf91-c12576ee.003f6...@isr.de%3e
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.