Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Speed issues
Message
From
22/07/2003 23:09:40
 
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00811416
Message ID:
00812632
Views:
12
>Here are some false Speeding issues reported by somebody
>
>Test it yourself and see.
>
>False statements:

>2. do while !eof with skip is slower than scan .. endscan got a 6 times faster with do while !eof() .. skip +1 ... enddo
>

How exactly did you test the scan endscan?

As I use it, I just select the table before "SCANNING" and even if I select another table within the scan, the endscan takes care of that for me. This is one benefit. Also Scan takes me to the top of the table!

Back to the speed issue, all things being equal, after the table is SELECTED then the code will be:

SCAN
ENDSCAN

AND for DO While...:

GO TOP
DO WHILE NOT EOF()
SKIP
ENDDO

This can only be tested by REBOOTING your computer each time as otherwise you get wrong results. Also VFP does not run alone on a windows computer and other things affect it as I have observed from above tests on a 2 million record table (300 MBytes):

RUN # SCAN DO WHILE (All times in seconds)
***** **** *******
1 39.625 33.789
2 23.173 21.363
3 21.154 21.087
4 19.955 19.900
5 19.890 21.443
6 30.453 21.252


I stopped testing after this.

Note:
I did NOT REBOOT my computer between these tests.

As I see it, the same thing is happening as with a SQL Select. VFP is using its buffers to read and manipulate the data which is why the same code gets faster and faster! That is until another windows process nudges in and grabs some CPU. There is no way of accurately testing this with so many variables. A reasonable gauge can be made but a REBOOT is a must between runs as the results will otherwise be skewed.

Maybe I may find the time to reboot my windows computer a number of times but with startup times going into > 2 mins a pop, I don't think I can afford it and besides its boring to restart.

Cheers

Bernard
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform