Vijay,

On Mon, 2010-05-10 at 06:17 -0400, Vijay Saraswat wrote:
> Russel Winder wrote:
> > On Mon, 2010-05-10 at 07:13 +0100, Russel Winder wrote:
[ . . . ]
> > My apologies to all on the X10 development team, I just spotted I didn't
> > have -O on when I thought I did.  With -O, the X10 code seems to be
> > faster than any other language!
> >   
> Right, thanks, numbers would be helpful.

        |> scons run_pi_cpp_sequential
        /usr/bin/python 
/home/Checkouts/Bazaar/SCons/Working/bootstrap/src/script/scons.py 
run_pi_cpp_sequential
        scons: Reading SConscript files ...
        scons: done reading SConscript files.
        scons: Building targets ...
        g++ -o pi_cpp_sequential.o -c -O3 -Wall 
-I/home/users/russel/Progs/Applications/Timing pi_cpp_sequential.cpp
        gcc -o /home/users/russel/Progs/Applications/Timing/microsecondTime.o 
-c -O3 -Wall /home/users/russel/Progs/Applications/Timing/microsecondTime.c
        g++ -o pi_cpp_sequential pi_cpp_sequential.o 
/home/users/russel/Progs/Applications/Timing/microsecondTime.o
        ./pi_cpp_sequential
        ==== C++ Sequential pi = 3.14159265358979194159017
        ==== C++ Sequential iteration count = 1000000000
        ==== C++ Sequential elapse = 9.718674000000000035015546
        scons: done building targets.
        508 anglides:~/Progs/Applications/Pi_Quadrature
        |> scons run_Pi_X10_Sequential_Cpp
        /usr/bin/python 
/home/Checkouts/Bazaar/SCons/Working/bootstrap/src/script/scons.py 
run_Pi_X10_Sequential_Cpp
        scons: Reading SConscript files ...
        scons: done reading SConscript files.
        scons: Building targets ...
        x10c++ -O -o Pi_X10_Sequential.x10_cpp Pi_X10_Sequential.x10
        runx10 Pi_X10_Sequential.x10_cpp
        ==== X10 Sequential pi = 3.141592653589971
        ==== X10 Sequential iteration count = 1000000000
        ==== X10 Sequential elapse = 8.609898401000001
        scons: done building targets.
        509 anglides:~/Progs/Applications/Pi_Quadrature
        |> 

I think the issue here is that I am using long double in the C++ code so
the above is not actually a fair comparison.  Making the change:

        |> scons run_pi_cpp_sequential
        /usr/bin/python 
/home/Checkouts/Bazaar/SCons/Working/bootstrap/src/script/scons.py 
run_pi_cpp_sequential
        scons: Reading SConscript files ...
        scons: done reading SConscript files.
        scons: Building targets ...
        g++ -o pi_cpp_sequential.o -c -O3 -Wall 
-I/home/users/russel/Progs/Applications/Timing pi_cpp_sequential.cpp
        g++ -o pi_cpp_sequential pi_cpp_sequential.o 
/home/users/russel/Progs/Applications/Timing/microsecondTime.o
        ./pi_cpp_sequential
        ==== C++ Sequential pi = 3.141592653589970751681903
        ==== C++ Sequential iteration count = 1000000000
        ==== C++ Sequential elapse = 8.595724999999999837996256
        scons: done building targets.
        513 anglides:~/Progs/Applications/Pi_Quadrature
        |> 

OK, that appears better.  Only a single data point of course so just an
indication, but it shows X10 and the C++ back end are doing the right
thing for this trivially small tight loop.

> In case you haven't seen this yet, the relevant page is
> 
> http://x10.codehaus.org/Performance+Tuning+an+X10+Application

I am not trying to get into the performance tuning and benchmarking game
(though if someone pays me to do so I am happy to start :-)

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: rus...@russel.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder



------------------------------------------------------------------------------

_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to