logo       

Re: [Pdl-porters] Benchmarks to appear in FSM: msg#00017

Subject: Re: [Pdl-porters] Benchmarks to appear in FSM
 Hello,

 I am getting confused now with inplace. The detailed code and times
are shown below.
I am running three tests trying to implement inplace operations
to make the code faster. The summary is:

Test #     command                                  time
1:      $Re=$Re+1000.;                          58 sec
2:      $Re.=$Re+1000.;                       109 sec
3:      $Re->inplace;$Re+1000.;            55 sec


 I believe test 3 is doing things really inplace, but its time is almost the
same as test 1, which is the "easy" way. Does this mean
that test 1 is really done inplace? Or maybe test 3 is not done inplace?

 I thought the .= operator performed operations inplace, and I would have
thought test 2 was also doing things inplace like test 3. Obviously it is
not. In fact it is taking twice the time to run probably meaning it is
doing the calculations twice. What am I missing here?

 Many thanks again,

 Xavier


*******************************************
Test 1
-----------------------------------------
$npts=2000;
$niter=1000;
$Re=zeroes(double,$npts,$npts)->xlinvals(-1.5,0.5);

for($j=0;$j<$niter;$j++){
   $Re=$Re+1000.;
}
------------------------------------------------
time output:

real    1m0.727s
user    0m22.794s
sys     0m36.667s

******************************************************
Test 2:
---------------------------------------------------
$npts=2000;
$niter=1000;
$Re=zeroes(double,$npts,$npts)->xlinvals(-1.5,0.5);

for($j=0;$j<$niter;$j++){
   $Re.=$Re+1000.;
}
------------------------------------------------------
time output:

real    1m53.829s
user    1m11.915s
sys     0m37.040s

*******************************************************
Test 3
-------------------------------------------------------
$npts=2000;
$niter=1000;
$Re=zeroes(double,$npts,$npts)->xlinvals(-1.5,0.5);

for($j=0;$j<$niter;$j++){
   $Re->inplace;
   $Re+1000.;
}
--------------------------------------------------------
time output:

real    0m33.181s
user    0m32.446s
sys     0m0.190s


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe