[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: Efficiency Question
#1 is the best thing to do in my opinion, probably the time is being spent in
some other action...
However, for more efficient writing, how about something like this:
[...]
let $evalstring = $proj_type || &pr.analysis_type || &pr.resource_type
if $proj_type = 'ABL' and (&pr.analysis_type = 'BLD' or &pr.analysis_type =
'CAS')
let $rr_sw = 'Y'
else
evaluate $evalstring
when = 'ACRBLDAPPLY'
when = 'ACRBLDUNIT'
when = 'ACRBLDCRREB'
when = 'ACRBLDCRWDN'
(all other combinations)
let $rr_sw = 'Y'
end-evaluate
end-if
[...]
Then you only have the one IF and one evaluate. If the ABLBLD* and ABLCAS*
entries are easy and set, you can add them too and only have the evaluate.
Hope this helps,
Buddy.
From: Stan Quick <stanley.quick@BRIO.COM> on 11/09/2000 10:42
To: SQR-USERS@list.iex.net@SMTP@Exchange
cc:
Subject: Re: Efficiency Question
1) Have you run the program without the evaluate to see the incremental time
difference? If the evaluate represents an insignificant percentage of the
time spent, it's probably not worth improving.
2) You can try something like this:
evaluate $proj_type
when = 'ABL'
if instr('BLD CAS',&pr.analysis_type,1) > 0
let $rr_sw = 'Y'
end-if
break
when = 'ACR'
if &pr.analysis_type = 'BLD'
if instr('APPLY UNIT CRREB CRWDN PBILL REWIP WDN
WUP',&pr.resource_type,1) > 0
let $rr_sw = 'Y'
end-if
end-if
break
etc...
-----Original Message-----
From: Rick_Creel@AONCONS.COM [mailto:Rick_Creel@AONCONS.COM]
Sent: Thursday, November 09, 2000 9:43 AM
To: SQR-USERS@list.iex.net
Subject: Efficiency Question
How efficient is an EVALUATE statement when processing large volumes of
data? I
did a rewrite on an old SQR that seemed to take too long to run; the
intention
was to improve overall run time & efficiency. I used the following code and
was
disappointed in the overall elapsed time. I know elapsed time is affected
by
many other factors & events happening in the system.... but thought I would
pose
the question to you folks anyway. Is there a better way to write this code?
Thanks for all your help!
My environment:
PSoft Ver 7.53
Oracle Ver 8.06 (Rule Based)
SQR Ver 4.34
My code:
let $rr_sw = 'N'
evaluate $proj_type
when = 'ABL'
if &pr.analysis_type = 'BLD' or &pr.analysis_type = 'CAS'
let $rr_sw = 'Y'
end-if
break
when = 'ACR'
if &pr.analysis_type = 'BLD'
if (&pr.resource_type = 'LABOR' or
&pr.resource_type = 'APPLY' or
&pr.resource_type = 'UNIT' or
&pr.resource_type = 'CRREB' or
&pr.resource_type = 'CRWDN' or
&pr.resource_type = 'PBILL' or
&pr.resource_type = 'REWIP' or
&pr.resource_type = 'WDN' or
&pr.resource_type = 'WUP')
let $rr_sw = 'Y'
end-if
end-if
break
when = 'EVT'
if &pr.analysis_type = 'BLD'
if (&pr.resource_type = 'MLSTN' or
&pr.resource_type = 'APPLY' or
&pr.resource_type = 'UNIT' or
&pr.resource_type = 'CRREB' or
&pr.resource_type = 'CRWDN' or
&pr.resource_type = 'PBILL' or
&pr.resource_type = 'REWIP' or
&pr.resource_type = 'WDN' or
&pr.resource_type = 'WUP')
let $rr_sw = 'Y'
end-if
end-if
break
when = 'UNT'
if &pr.analysis_type = 'BLD'
if (&pr.resource_type = 'APPLY' or
&pr.resource_type = 'UNIT' or
&pr.resource_type = 'CRREB' or
&pr.resource_type = 'CRWDN' or
&pr.resource_type = 'PBILL' or
&pr.resource_type = 'REWIP' or
&pr.resource_type = 'WDN' or
&pr.resource_type = 'WUP')
let $rr_sw = 'Y'
end-if
end-if
break
end-evaluate
if $rr_sw = 'Y'
do get_manager_info
end-if