Stefan Bodewig <bode...@apache.org> wrote on 22.03.2010 14:04:54:
 
> This could mean the "variable" task has been slowed down (since the
> string gets longer with each invocation) or the loop itself has been
> slowed down.  Can you isolate the two possibilities by not doing
> anything inside the loop?
> 
> I'm not too familiar with the for task, but you say you are using a
> "path-like structure" in one place and "fileset" in another.  In case it
> is a <path> it may be that Ant 1.7.1 used to cache its contents while it
> no longer does so for 1.8.0 (and thus would rescan the filesystem on
> each iteration) - hmm, I think it shouldn't have been cached in 1.7.1
> either <https://issues.apache.org/bugzilla/show_bug.cgi?id=41151>.
> 
> Anyway, there is a (undocumented) cache attribute on <path>, can you set
> this to true and see whether it helps?
> 
> Stefan
>

Hello Stefan,

I could track the performance leak down to the Ant-Contrib "variable" 
task. As you wrote, it seems this task has slowed down since the string 
gets longer with each invocation. If I comment out the suspicious line, 
the Ant script runs equally fast on 1.8.0 and 1.7.1. BTW, I'm using a path 
based on a fileset, but the (undocumented) cache attribute on <path> 
didn't help.

I wrote a little demonstration ant script, packed the necessary 
Ant-Contrib JAR beside it, and dropped the ZIP file on Sendspace: 
http://www.sendspace.com/file/b4zcmo. Please feel free to test it. Below 
is the output for 1.7.1 versus 1.8.0 on my machine.

Regards,
Christoph

PS: Here's the output

---8<--- Snip 
---8<----------------------------------------------------------------------------------------
cgroth...@isrbsnb314:/data/work/AntDebug$ export ANT_HOME=/opt/ant/1.7.1/
cgroth...@isrbsnb314:/data/work/AntDebug$ ant
Buildfile: build.xml

prepare:
     [echo] 
################################################################################
     [echo] This is the Ant and Ant-Contrib Performance Leak debugging 
script
     [echo] Ant Version: Apache Ant version 1.7.1 compiled on June 27 2008
     [echo] 
################################################################################
    [mkdir] Created dir: /data/work/AntDebug/target
     [copy] Copying 150 files to /data/work/AntDebug/target

test:
     [echo] Writing the content of property "testvar" to 
target/testoutput.xml

BUILD SUCCESSFUL
Total time: 0 seconds
cgroth...@isrbsnb314:/data/work/AntDebug$ export ANT_HOME=/opt/ant/1.8.0/
cgroth...@isrbsnb314:/data/work/AntDebug$ ant
Buildfile: /data/work/AntDebug/build.xml

prepare:
     [echo] 
################################################################################
     [echo] This is the Ant and Ant-Contrib Performance Leak debugging 
script
     [echo] Ant Version: Apache Ant version 1.8.0 compiled on February 1 
2010
     [echo] 
################################################################################

test:
     [echo] Writing the content of property "testvar" to 
target/testoutput.xml

BUILD SUCCESSFUL
Total time: 8 seconds
cgroth...@isrbsnb314:/data/work/AntDebug$ 

Reply via email to