Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
COPY TO ARRAY against a cursor?
Message
From
06/08/2019 17:39:02
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
05/08/2019 18:47:10
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., New Zealand
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01669872
Message ID:
01669933
Views:
62
So it is faster for 4-5 rows??? What about 10 or 15? My results with 11 rows:

Using COPY TO ARRAY 10000 passes took 0.330.Records in result = 11
Using SQL SELECT 10000 passes took 0.327.Records in result = 11
Using SQL SELECT to cursor 10000 passes took 0.440.Records in result = 11

In a real world application, who would ever choose one over another with these scores. IMHO They are close enough to be negligible.



>VFPA 32-bit performance using your code, eliminating the local array declaration and changing last loop to into cursor:
>
>
Using COPY TO ARRAY, 10000 passes took 0.079; records in result = 5
>Using SQL SELECT, 10000 passes took 0.508; records in result = 5
>Using SQL SELECT to cursor, 10000 passes took 0.466; records in result = 5
>
>VFPA x64:
>
>
Using COPY TO ARRAY, 10000 passes took 0.086; records in result = 5
>Using SQL SELECT, 10000 passes took 0.691; records in result = 5
>Using SQL SELECT to cursor, 10000 passes took 0.634; records in result = 5
>
>That's with SET TALK OFF. SET TALK ON and it's heaps slower, with COPY TO ARRAY now slowest- e.g VFPA 32bit:
>
>
Using COPY TO ARRAY, 10000 passes took 1.865; records in result = 5
>Using SQL SELECT, 10000 passes took 1.364; records in result = 5
>Using SQL SELECT to cursor, 10000 passes took 1.403; records in result = 5
>
>SET EXCL also seems to make a slight difference, though that's hardly a surprise.
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform