ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Meyer <mike65...@yahoo.de>
Subject Re: Ant build slower on two cores than on one core?
Date Thu, 13 Mar 2008 15:12:42 GMT

--- Steve Loughran <stevel@apache.org> schrieb:

> Michael Meyer wrote:
> >>  --- Steve Loughran <stevel@apache.org> schrieb: 
> >>> this is really interesting. I'd thought javac
> was
> >>> unthreaded too, but 
> >>> even so you'd expect file IO to work in the
> other
> >>> CPU, so get a boost 
> >>> from the second core.
> >>>
> >>> what happens when you try a different javac,
> like
> >>> the eclipse one?
> > 
> > In order to rule out any pathologies in my ant
> build
> > file or my source code, I benchmarked a compile
> run
> > again, this time the compilation of the Ant 1.7.0
> > source code.
> > 
> > Additionally, I have deinstalled the powernowd
> > package, so the frequency of the cpu is not
> reduced
> > when idle, rather all the time at 2.4 GHZ (Intel
> Core
> > 2 Duo E6600).
> > 
> > Compile run this time with:
> > 
> > ant clean ; ant build ; ant clean ; sleep 10 ;
> time
> > ant build
> > 
> > (This way, every file to be compiled and the jdk
> files
> > are preloaded into memory, and before the timed
> ant
> > build there is a wait period of 10 seconds so that
> the
> > journal daemon from the ext3 file system can write
> all
> > emitted byte code files (done every 5 seconds by
> > default) before the actual compile run starts.) 
> > 
> 
> -this is interesting stuff. Stick it up on a web
> page and I'll point to it.
> 
> At the same time, I dont know why it is happening.
> It does hint at 
> something I've been seeing on my desktop though, in
> which builds in 
> VMWare images (with a single CPU option) seem faster
> than the stuff on 
> the main desktop.
> 
> 1. I wonder if we are doing some kind of
> synchronisation on I/O that is 
> causing us to take longer to acquire locks?
> 
> 2. A good test would be to focus on javac and see if
> a .sh script to 
> build the classes shows the same slowdown. if it
> does, its a javac 
> problem. If it doesnt, its an ant problem.

I build a script which compiles every java class
except those in
apache-ant-1.7.0/src/main/org/apache/tools/ant/taskdefs/optional/ejb/
and the compile run took almost as long as the compile
run with 'ant build' on 1 core (both with 1 and 2
cores):

1 core:
-------
real	0m4.096s
user	0m3.884s
sys	0m0.168s

2 cores:
--------
real	0m3.694s
user	0m4.180s
sys	0m0.160s

the old complete compile run with ant (time ant
build) was:

1 core:
	real	0m4.520s
 	user	0m4.312s
 	sys	0m0.176s
 
2 cores:
 	real	0m8.150s
 	user	0m14.849s
 	sys	0m0.400s

So each time is around 4 seconds, except the build
using ant with two cores.

After fiddling around with cpulimit on linux for some
time, I did not manage to reduce the ant build time on
two cores significantly.

But I guess solaris has more possibilities to limit
the processor usage or core usage of a single user. So
the build process might run as a different user and
this user could have limited cores available. This
should decrease the build time.

On mere build servers running linux one could disable
the second core at boot time permanently to reduce the
build time, if no other processes are running on this
server.

But on workstations the second core is often used by
the application being developed if it is
multithreaded, so there might be no way in linux to
reduce the build time wih two cores?






      E-Mails jetzt auf Ihrem Handy.
www.yahoo.de/go


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


Mime
View raw message