Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: compiling ant to a native binary



Just another thought... a number of tasks will either spawn a new JVM automatically (e.g. JavaDoc) or will do so based upon a flag (e.g. the "java" command's "fork" attribute). If the task you're running is a normal command-line java app, it's entirely possible that the ant command to invoke it simply starts a new instance of that application just like 'make' would have. In that case, the excessive time you're seeing may well be starting up the JVM for each subprocess (and indeed, possibly for each file). If this is the case, then the best performance boost would be to write an Ant task which invokes the desired functionality (if possible) within the Ant process. The Ant documentation is pretty good on exactly how one does this.

Cheers!
Andrew Miner

On Wednesday, August 27, 2003, at 11:51AM, <email@hidden> wrote:

>Matthew Hixson wrote:
>| I'm actually not compiling anything with ant during the development
>| phase. My EJB classes contain xdoclet tags which are then used to
>| create the interfaces for my beans and the deployment descriptors for
>| JBoss. Ant/xdoclet just takes a long time to chug through the sources
>| and generate the necessary files. It seems to me that a native
>| application to do this should be quite a bite faster.
>
>I'm guessing that the relevant file-generation code is in Java (being utterly ignorant of all things EJB and most things ant). Unless ant spins off new instances of the JVM for each file, I wouldn't expect creating native code to improve things much: generating native code is what the HotSpot JVM is supposed to do, and this would seem to be the sort of circumstances in which that approach would shine.
>
>| I'm seeing anywhere from 40 seconds to 1.5 minutes depending upon how
>| many classes have changed since the last run. A not insignificant
>| part of that is probably just the JVM starting up.
>
>If forty seconds is the minimum (when a single file has changed), then JVM startup may well be the problem. Or it could be that that's how long it takes ant to sort through all the files figuring out what needs doing. Again, only measurements can say. If it *is* ant, then it may be better to see if ant's algorithms can be improved than to look for ways to create a native binary.
>
>Glen Fisher
>_______________________________________________
>java-dev mailing list | email@hidden
>Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
>Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
>Do not post admin requests to the list. They will be ignored.
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.