views:

217

answers:

2

New Ant 1.8.0 (release Feb 1) introduces some cool features, so I tried my build/deployment scripts with new Ant.

I was surprised that execution time becomes in 10-30 times slower for some targets! Below simple example with Exec task, although I got performance problems with other task types too.

<target name="create_backup_impl" if="db.make_backup" >
    <echo message="Backup is starting.." />
    <exec executable="${db.dump_executable}"    
            output="${db.backup_file}"
            failonerror="true">
        <arg value="-h${db.host}" />
        <arg value="-u${db.userid}" />
        <arg value="-p${db.password}" /> 
        <arg value="${db.backup_options}" /> 
        <arg value="${db.name}" />      
    </exec>
    <echo message="Backup completed!" />
</target>

It is a target for backuping database (backup size ~100 Mb). Ant 1.7.1 works about 30 s, Ant 1.8.0 - 15 min. I tried several times, effect is stable. Processor loading is very low for Ant 1.8, and near 50% for old one. Looks like problem with priority of process or slow IO operations. Any ideas?

+1  A: 

I would suggest filing a bug report directly with Ant team. Their response time is usually very good.

http://ant.apache.org/bugs.html

Alexander Pogrebnyak
A: 

I'm seeing similar performance degradation when using

<apply executable="...">
   ...
</apply> 

Looks like this performance degradation was caused by a 9 year old bug fix in ANT 1.8.0 found here: https://issues.apache.org/bugzilla/show_bug.cgi?id=5003 (See comment #29).

Performance slightly improves in ANT 1.8.1 but is still worse than ANT 1.7.1: https://issues.apache.org/bugzilla/show_bug.cgi?id=48734 (See comment #2).

jenglert