Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Which is faster: array or cursor?
Message
From
09/03/2009 16:47:14
Walter Meester
HoogkarspelNetherlands
 
 
To
09/03/2009 16:41:29
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., New Zealand
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01386748
Message ID:
01386777
Views:
107
>Using this exact same code, cursor was 3 seconds slower than using an array on my dual core machine
>
>Probably depends on whether VFP spans the cursor to disk. ;-)

? FILE(DBF()) returns .F., so, no the cursor does not hit the disk. It must be something else.



>Cursors are definitely quicker if the algorithm loops quickly and benefits from an index. In this case it doesn't, so probably there's no great advantage to be found. Referring to field names may be more readable than array dimensions, though you can achieve similar readability using #DEFINES.
Previous
Reply
Map
View

Click here to load this message in the networking platform