Bug 20557 - Running an empty ant script takes about 2 seconds
Summary: Running an empty ant script takes about 2 seconds
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P2 enhancement (vote)
Target Milestone: 2.1 M2   Edit
Assignee: Jared Burns CLA
QA Contact:
URL:
Whiteboard:
Keywords: core
: 21594 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-06-18 14:06 EDT by Rodrigo Peretti CLA
Modified: 2002-11-13 07:36 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rodrigo Peretti CLA 2002-06-18 14:06:51 EDT
build F3

From Ryan Cooper's annotation on bug 20336:

Running an empty ant script takes about 2 seconds. If we add the build kind 
variable and pass it through, and the script checks it and does nothing for 
the "wrong" kinds of builds, there will still be a 2 second delay for 
the "wrong" builds.

With this in mind, are we gaining enough from adding the build kind variable 
to make it worthwhile to add it for 2.0? Or should we wait until we can add a 
full (checkbox) solution after 2.0?
Comment 1 Rodrigo Peretti CLA 2002-06-18 14:07:49 EDT
About the 2 seconds problem. It does not seem alarming but we do need more 
investigation on it. Every time an Ant script is run we create a new 
classloader and put all the necessary JARs in the classpath (ant.jar, 
xerces.jar, etc...). Given it has to load all the necessary classes again and 
again it might be where the time is going. We do that for the uset to be able 
to extend the Ant classpath at runtime. But I agree there could be some kind 
of optimization in this area after 2.0.
Comment 2 Rodrigo Peretti CLA 2002-06-24 09:48:35 EDT
Defer.
Comment 3 Rodrigo Peretti CLA 2002-08-12 14:36:35 EDT
Reopening for investigation.
Comment 4 Rodrigo Peretti CLA 2002-08-12 15:42:48 EDT
*** Bug 21594 has been marked as a duplicate of this bug. ***
Comment 5 Rodrigo Peretti CLA 2002-08-12 16:09:23 EDT
Basic tests indicate that caching the classloader can improve the time of 
running a simple "Hello World" script in 2 to 3 times. Although it seems 
tempting to just go and change it we have to consider that Ant users usually 
run buildfiles using different VM instances. So, we can face some 
unexpected/untested behaviour from Ant and its tasks.
Comment 6 Darin Swanson CLA 2002-10-01 17:06:20 EDT
Rodrigo, can you please explain: "Ant users usually run buildfiles using 
different VM instances"?  My understanding is that currently we always run in 
the same VM as Eclipse is running (a single instance).
Comment 7 Rodrigo Peretti CLA 2002-10-01 17:12:17 EDT
I meant users that run Ant through the command line and not using any IDE. If 
a task was developed and always tested in this kind of environment there is 
possibility of side effects if we cache the classloader.
Comment 8 Darin Swanson CLA 2002-10-02 10:20:04 EDT
Changes in AntCorePlugin and AntRunner
Please verify (Jared)
Comment 9 Jared Burns CLA 2002-10-04 11:56:04 EDT
Verified. Much better.
Comment 10 Jochen Wiedmann CLA 2002-11-13 07:36:58 EST

This patch would probably solve another issue: If an Ant task is
currently using the DB2 database, one cannot rerun the same Ant task
later. The reason is that the DB2 driver depends on JNI. In other
words, only one ClassLoader can use the driver.

There's still a problem left: It doesn't seem to be possible that
two plugins share the DB2 driver, at least not, if they have own
ClassLoaders. For example, the Quantum plugin (http://quantum.sf.net)
and the Ant plugin, have this problem.