Date: Thu, 5 Jun 2008 09:37:25 -0400
Reply-To: "Howard Schreier <hs AT dc-sug DOT org>"
<schreier.junk.mail@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Howard Schreier <hs AT dc-sug DOT org>"
<schreier.junk.mail@GMAIL.COM>
Subject: Re: How to compare the time taken for a SAS process
On Tue, 3 Jun 2008 11:41:51 +0100, cherish k <hawks_cherish@YAHOO.CO.IN> wrote:
>Hi SAS-L users,
>
>I want to understand how SAS processes a step. SAS processes record by record.
>
>But want to understand how much time it takes in different circumstances
like the example quoted below.
>
>1493 data test(drop = i j );
>1494 do i = 1 to 100000;
>1495 do j = 1 to 100;
>1496 array a(100);
>1497 a(j) = ranuni(0);
>1498 end;
>1499 output;
>1500 end;
>1501 run;
>
>NOTE: The data set WORK.TEST has 100000 observations and 100 variables.
>NOTE: DATA statement used (Total process time):
> real time 5.78 seconds
> cpu time 3.06 seconds
>
>
>1502
>1503
>1504 data test1;
>1505 set test;
>1506 if a1 < 0.2 then output;
>1507 run;
>
>NOTE: There were 100000 observations read from the data set WORK.TEST.
>NOTE: The data set WORK.TEST1 has 19900 observations and 100 variables.
>NOTE: DATA statement used (Total process time):
> real time 0.32 seconds
> cpu time 0.28 seconds
>
>
>1508
>1509 data test(drop = i);
>1510 do i = 1 to 100000;
>1511 a1 = ranuni(0);
>1512 output;
>1513 end;
>1514 run;
>
>NOTE: The data set WORK.TEST has 100000 observations and 1 variables.
>NOTE: DATA statement used (Total process time):
> real time 0.04 seconds
> cpu time 0.03 seconds
>
>
>1515
>1516
>1517 data test1;
>1518 set test;
>1519 if a1 < 0.2 then output;
>1520 run;
>
>NOTE: There were 100000 observations read from the data set WORK.TEST.
>NOTE: The data set WORK.TEST1 has 19831 observations and 1 variables.
>NOTE: DATA statement used (Total process time):
> real time 0.03 seconds
> cpu time 0.03 seconds
>
>
>As you see the second step which has one variable runs much faster than the
one with 100 variables with same number of records.
>
>How to compute the time difference between two codes based on the number of
operations i.e. in terms of variables only (not w.r.t the different logic or
anything). This is of importance when merging two tables using SQL with some
unnecessary fields.
>
>I know RAM and processor speed helps in computing but am totally blank on
how to do it. If somebody helps me or directs me to some material (which am
unable to get) that would be of great help.
>
>For the above example my system configurations are
>1 GB RAM, Intel Pentium Processor 1.86 Ghz (335 Mhz)
>
>
>Regards,
>Cherish
Books and papers have been written about processing efficiency issues. They
all (I believe) conclude that exclusion of unneeded data speeds things up.
As to quantitatively *forecasting* the processing time for a task: it may be
possible for simple cases as in the example above, but in real work things
get more complex. It's more common to test on subsets and extrapolate.
|