Really slow processing

Jeff Harrison jeffaharrison at yahoo.com
Fri Aug 26 10:29:08 PDT 2011


----- Original Message -----

> From: Bob <roberth at sim-soft.com>
> To: fplist <filepro-list at lists.celestial.com>
> Cc: 
> Sent: Friday, August 26, 2011 12:57 PM
> Subject: Really slow processing
> 
> I've got a client that has recently upgraded from windows server 2003 to 
> server 2008.  The workstations have been upgrade as well from xp to win7.
> 
> What they have found is that when a selection routine is running (-v) it's 
> taking substantially longer to select records.
> ........there's over 1M records to select from.
> 
> Here's the code:
> ::gosub setvar:
> ::logtext "fl="{fl:
> :fl eq "":gosub enter:
> ::gosub getmst; gosub sel:
> ::a=inkey:
> :a ne "":exit:
> ::end:
> setvar:::
> ::xa(4,*,g); fl(1,*,g); rn(1,.0)="1":
> ::return:
> enter:::
> ::input ("5","10") yn(1,yesno) "Post Agent 
> Balances(Y/N)":
> :yn eq "":goto enter:
> :yn eq "N":exit:
> ::fl="x":
> ::return:
> getmst:::
> ::lookup master r=rn -n:
> ::xd=master(14);xe=master(15):
> ::master(14)="";master(15)="":
> ::'close master:
> ::return:
> sel:::
> : 3 lt xd or 3 gt xe:return:
> :5 eq "C" or 5 eq "O":select:
> ::return:
> 
> Notice the "close" statemnet in the lookup subroutine.  I commented 
> this out to see the effect.  It made the process considerably faster but still 
> much slower than the old system.  On the old system this would take maybe 3 or 4 
> minutes and now it's taking at least 10X that much.
> 
> Any suggestion on speeding the process?
> 
> Oh, they are running fp 5.0.9 I believe.
> 
> 
> Bob
> "The nonGeek Geek"

This is a good example of what not to do on a few fronts.  First of all, the inkey is almost certainly slowing you down, and It has no purpose that I can see (other than slowing you down).  Secondly, good, you got rid of the close - that is a start.  It does not make sense to keep looking up the same record, then close it - for each record that is read.  setvar only needs to run once - or not at all if you make rn global and move the "rn(1,.0,g)=1" to the "enter" subroutine.  Also, you can then move the getmst into the "enter" routine and make the xd and xe fields global as well if they are not already.

Also, I see that you are writing to the master file - clearing out fields 14 and 15 - is that intended?  If f so, then you should protect the lookup and you should execute a write master (or uncomment the close).  This would not be a speed issue as you would only be executing this once  - instread of  the 1 million times that you are currently getting.

That is all that I see from a quick look - but thats a bunch!

Jeff Harrison
jeffaharrison at yahoo.com
Author of JHExport and JHImport













>


More information about the Filepro-list mailing list