Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Which is faster: array or cursor?
Message
From
09/03/2009 16:41:29
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., New Zealand
 
 
To
09/03/2009 16:30:18
Walter Meester
HoogkarspelNetherlands
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:
01386775
Views:
118
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. ;-)

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.
"... They ne'er cared for us
yet: suffer us to famish, and their store-houses
crammed with grain; make edicts for usury, to
support usurers; repeal daily any wholesome act
established against the rich, and provide more
piercing statutes daily, to chain up and restrain
the poor. If the wars eat us not up, they will; and
there's all the love they bear us.
"
-- Shakespeare: Coriolanus, Act 1, scene 1
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform