ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dick, Brian E." <Brian.D...@FMR.com>
Subject RE: Parallel vs Sequential
Date Wed, 05 Apr 2006 11:52:41 GMT
Does you machine have multiple CPU's and disks? Parallel tasks on a
single CPU/disk machine can only improve performance if there is
significant CPU/IO overlap. A compiler is CPU and disk intensive with
little CPU/IO overlap. If you don't have parallel hardware, parallel
software won't improve performance.

-----Original Message-----
From: Shree [mailto:shreedharn@amiindia.co.in] 
Sent: Wednesday, April 05, 2006 6:38 AM
To: Ant Users List
Subject: Parallel vs Sequential


Hi Stefan,

I tried evaluating the performance of "<parallel> task" with sequential 
way doing(without using <parallel>) a set of tasks. I find <parallel> 
does not help to improve the performance much and infact it sometimes 
even slower than sequential(as far I had experimented with some
examples).

 I did several examples. One such method was -  I tried compiling c 
files in 3 different folders(src1,src2,src3). The destination folder for

the created objs were different say src1->obj1, src2->obj2, src3->obj3.

I had 3 xml files, parallel.xml, sequential.xml and template.xml. 
Template.xml contains the logic for compiling cfiles.

<!- source of template.xml  -->
<project name = "template" basedir="." default = "All">
<!-- the properties are passed as parameters from main build, in this 
case either parallel.xml or sequential.xml -->
    <target name = "All" depends = "create_dir">
        <cc name = "msvc" outtype = "executable" objdir = "${objdir}">
            <includepath path = "${includes}"/>
            <fileset refid = "${SrcID}"/>
        </cc>
    </target>
   
    <target name = "create_dir">
        <mkdir dir = "${objdir}"/>
    </target>   
</project>

Parallel.xml is the main build file that  invokes the target "all"  
within a parallel task, so all the c-files in the 3 different folders 
are compiled into objs parallely while sequential is another build file 
that invokes the target "all" for each folders sequentially(without 
parallel task). I expected parallel to finish faster, but found 
sequential outperforming parallel most of the times.

Code snippet from parallel.xml
-------------------------------

<parallel>

            <ant antfile="template.xml" inheritrefs="true">
                <property name = "SrcID" value="CSource"/>
                <property name = "includes" 
value="${env.include};${basedir}\cSource\Build"/>
                <property name = "objdir" value="${basedir}\Build1" />
            </ant>
           
            <ant antfile="template.xml" inheritrefs="true">
                <property name = "SrcID" value="CSource2"/>
                <property name = "includes" 
value="${env.include};${basedir}\cSource\Build"/>
                <property name = "objdir" value="${basedir}\Build2" />
            </ant>
           
            <ant antfile="template.xml" inheritrefs="true">
                <property name = "SrcID" value="CSource1"/>
                <property name = "includes" 
value="${env.include};${basedir}\cSource\Build"/>
                <property name = "objdir" value="${basedir}\Build3" />
            </ant>
</parallel>

whereas in sequential.xml I do not use <parallel> task. Comparing the 
time for compiling files in sequential and parallel mode, I find using 
<parallel> does not improve the performance. If one argues that there 
are " no i/o or legitimate cpu wait/sleep" in the above code,  for which

- I also experimented with task that performs file i/o(Concat task) in 
parallel and sequential mode, still there were no results in favor of 
<parallel> task. What is wrong and where one should use "Parallel" tasks
?

Thank you,

Best regards
Shreedhar



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

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


Mime
View raw message