ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <peter.rei...@corvil.com>
Subject Re: AW: AW: ANT1.6 much more slower than 1.5
Date Wed, 10 Dec 2003 18:02:54 GMT
Hi Antoine,
Sorry my e-mail was not very clear.
The problem is not the inheritance of references. It is
the use of references.

In ant 1.5:
<project default="target">
<fileset id="x" dir="."/>
<target name="target">
<echo>Hello world</echo>
</target>
</project>

does not cause the fileset to be evaluated.

In ant 1.6 the fileset is evaluated, (calling DirectoryScanner.scan()) 
even if it is not used due to this
code in Project.java:

public void addReference(String name, Object value) {
synchronized (references) {
Object old = ((AntRefTable) references).getReal(name);
if (old == value) {
// no warning, this is not changing anything
return;
}
if (old != null && !(old instanceof UnknownElement)) {
log("Overriding previous definition of reference to " + name,
MSG_WARN);
}
String valueAsString = "";
try {
valueAsString = value.toString(); // <---- the fileset is evaluated here
} catch (Throwable t) {
log("Caught exception (" + t.getClass().getName() + ")"
+ " while expanding " + name + ": " + t.getMessage(),
MSG_WARN);
}
log("Adding reference: " + name + " -> " + valueAsString,
MSG_DEBUG);
references.put(name, value);
}

With antcall, this effect gets multiplied in a very bad fashion.

In Jose's original e-mail, he said that he was using lots of foreach and 
antcalls.
Most reasonably large build files would use a number of references 
(classpaths
etc).
(Using antcalls and foreach is itself currently inefficent due to the 
reparsing of the build files and the
coping of properties, definitions and references, thus somewhat masking 
the reference inefficincy).

The easiest fix would be to remove the debug log (easy) and more the warning
message to were the reference is used (?hard?).

Peter


Antoine Levy-Lambert wrote:

>Hi,
>
>A workaround for people migrating from ant 1.5 to ant 1.6 and wanting to
>keep antcall is to set inheritrefs to false.
>
>I have found the diffs for the fix which I checked in on July 22nd.
>http://marc.theaimsgroup.com/?l=ant-dev&m=105887513827839&w=2
>Is this improvable for performance ?
>
>Is this really such a critical problem to deliver ant 1.6 ?
>
>Cheers,
>
>Antoine
>
>
>
>-----Ursprungliche Nachricht-----
>Von: Peter Reilly [mailto:peter.reilly@corvil.com]
>Gesendet: Mittwoch, 10. Dezember 2003 17:04
>An: Ant Developers List
>Betreff: Re: AW: ANT1.6 much more slower than 1.5
>
>
>Antoine Levy-Lambert wrote:
>
>  
>
>>Hi Jose,
>>
>>what you are saying is that <antcall/> is slower in ant1.6 than in ant1.5,
>>and that you can fix the problem partly by moving
>>to macrodef.
>>
>>The question is : what made antcall slower in 1.6
>>
>>The one change I remember is :
>>Allow references to be properly inherited via antcall Bugzilla Report
>>    
>>
>21724.
>  
>
>>    
>>
>Awesome... =-O
>Well done. I was bashing my head against a wall looking into this. :-(
>For my simple scripts, ant 1.6 (using crimson as against xerces) was
>faster than ant 1.5. 8-)
>But now this script:
>
><project default="y">
><fileset id="set" dir=".">
><include name="**/*.xml"/>
></fileset>
><target name="y">
></target>
></project>
>Takes 1.5 seconds on ant1.6 against 1.2 on ant 1.5.
>and without the id:
>
><project default="y">
><fileset dir=".">
><include name="**/*.xml"/>
></fileset>
><target name="y">
></target>
></project>
>
>Takes 0.55 on ant1.6 against 1.1 on ant 1.5.
>
>Using antcall makes this effect much worse:
><project default="calls">
><fileset id="set" dir=".">
><include name="**/*.xml"/>
></fileset>
><target name="y">
></target>
><target name="calls">
><antcall target="y"/>
><antcall target="y"/>
><antcall target="y"/>
><antcall target="y"/>
><antcall target="y"/>
><antcall target="y"/>
><antcall target="y"/><project default="calls">
><fileset id="set" dir=".">
><include name="**/*.xml"/>
></fileset>
><target name="y">
></target>
><target name="calls">
><antcall target="y"/>
><antcall target="y"/>
><antcall target="y"/>
><antcall target="y"/>
><antcall target="y"/>
><antcall target="y"/>
><antcall target="y"/>
><antcall target="y"/>
><antcall target="y"/>
><antcall target="y"/>
></target>
></project>
><antcall target="y"/>
><antcall target="y"/>
><antcall target="y"/>
></target>
></project>
>
>Takes 4.5 seconds on ant1.6 against 1.4 seconds on ant1.5.
>
>Peter
>
>  
>
>>I do not know whether this is the culprit.
>>
>>Antoine
>>
>>-----Ursprungliche Nachricht-----
>>Von: Jose Alberto Fernandez [mailto:jalberto@cellectivity.com]
>>Gesendet: Mittwoch, 10. Dezember 2003 15:48
>>An: dev@ant.apache.org
>>Betreff: ANT1.6 much more slower than 1.5
>>
>>
>>OK, here are some more issues.
>>
>>I am running the my main build in ANT 1.6 vs 1.5
>>and I am getting very disapointing numbers:
>>
>>On ANT1.5 a full build takes 9m23s
>>
>>On ANT1.6b3 the same build takes 14m12s (!!!!!)
>>
>>On ANT1.6b3 a modified version of the build takes 11m3s
>>
>>This is after modifying the build for 1.6 to use
>><macrodef> in a couple of obvious places instead of <antcall>.
>>
>>This is on a build file with over 2500 lines and with
>>numerous <antcall> and <foreach> loops.
>>
>>I can extrapolate from this two things:
>>
>>a) <macrodef> really helps in 1.6.
>>
>>b) I will have to convert a lot of the code to just
>>get the performance I had before. If I move the
>>rest of the developers to 1.6 as is, they will kill me.
>>They already complain the build takes too long.
>>
>>Any insight on what we should look into?
>>We cannot ship 1.6 with such issues, I do not think.
>>
>>Jose Alberto
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>For additional commands, e-mail: dev-help@ant.apache.org
>
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message