Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Currency data type, BUG or FEATURE?
Message
De
11/03/2006 08:00:34
 
 
À
10/03/2006 21:30:17
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01102959
Message ID:
01103370
Vues:
14
>>Dragan, I have performed several naive test and have found the following:
>>
>>1st Fastest time: ALL fields are double. Average time to complete the test: 6.15
>>2nd fastest time: there are mixed Double and Currency, but all currency are converted to double with MTON(). Average time: 6.25
>>3rd fastest time: all fields are currency. Average time: 7.5
>>4th fastest time: Currency and Double fields are mixed and not casted nor converted. Average time: 8.6
>>5th fastest time: Currency and Double fields are mixed, and currency is CAST() to double. Average time: 9.25
>>6th fastest time: all fields are Float. Average time: 9.7
>>Slowest time: all fields are converted to currency with NTOM(). Average time: 11.8
>>
>>So the fastest seems to have all fields as doubles. Food for thought.
>
>Seems to be doubles are the best - probably because the arithmetic for them was written back in the 80s, and perfected meanwhile (only, of course, it had to be extended for longer mantissa and exponent). Also possible that the calculation is passed to the FPU in the processor.
>
>It would be interesting to try with a classic N(n,d) format as well - these would be automatically converted into doubles as soon as they're used in any calculation. My take these would be slower, as they are stored as an ASCII representation, not binary, but the slowness would be only in the field reading or writing, not the actual in-memory operation.
>
>Also, another interesting thing to test would be just memory operation, i.e. no cursors, no fields, just variables.
>
>Sounds like I'm giving you homework, uh? :) The reason is that I don't have the time, really - got to try some other things tonight before hitting the road tomorrow.

Dragan, N(n,d) is as slow as F(n,d), so it is at the 6th place. I cannot run my test with variables, as it is very difficult to match the number of operations, as my test invloved a mix o several SUM and CALCULATE commands over a 50.000 record table. Besides, you have to test with the m. and without, both affecting the results.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform