Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Enhancing Performance
Message
From
20/06/2014 07:40:56
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Enhancing Performance
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01602118
Message ID:
01602118
Views:
154
Using the following code I am updating some Data in a Cursor which has more than 5000000 Records.

The Initial Speed is tremendous but as the number of records scanned the speed gets slow down. Kindly Guide How could I enhance the performance.

Any alternative suggestion or Idea is also welcome.

Here is my code
Insertone=0
Inserttwo=0
lmultipage=.F.

SCAN
Newpath=Newpath
WAIT WINDOW m.Newpath NOWAIT
CREATE CURSOR BillFile (POS Varchar(254))
APPEND FROM (m.Newpath) SDF

SELECT Billfile

GO Bottom
DO WHILE NOT BOF()

IF LEFT(POS,8)='(Page 1)'
cTextone='<</Duplex false/PageSize  [595 842] /Tumble false /ManualFeed false /MediaPosition 0>>  setpagedevice'
Insertone=1
Inserttwo=0
ENDIF

IF LEFT(POS,8)='(Page 3)'
lmultipage=.T.
ENDIF


IF LEFT(POS,8)='(Page 2)' 
Insertone=0
Inserttwo=1

IF lmultipage=.T.
cTexttwo='<</Duplex true /PageSize [595 842]/Tumble false /ManualFeed false /MediaPosition 2>> setpagedevice'
ELSE
cTexttwo='<</Duplex false /PageSize [595 842]/Tumble false /ManualFeed false /MediaPosition 2>> setpagedevice'
ENDIF
lmultipage=.F.
ENDIF

IF POS='%%BeginPageSetup' 
IF Insertone=1
INSERT Blank
Replace pos WITH cTextone
Skip-2
Insertone=0
Inserttwo=0
ENDIF
ENDIF

IF POS='%%BeginPageSetup' 
IF Inserttwo=1
INSERT Blank
Replace pos WITH cTexttwo
Skip-2
Insertone=0
Inserttwo=0
ENDIF
ENDIF


Skip-1
WAIT WINDOW 'Remaining Records...'+ALLTRIM(STR(RECNO())) NOWAIT
ENDDO

Set Textmerge On
Set Textmerge To (m.NEWPATH) Noshow
Scan
\\<< TRIM(POS) >>
\
Endscan
Set Textmerge To
Set Textmerge Off
SELECT New_bills
ENDSCAN 
Regards
Harsh
Harsh
Next
Reply
Map
View

Click here to load this message in the networking platform