General information
Category:
Coding, syntax & commands
Environment versions
Network:
Windows 2003 Server
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.
>>So are ther any advantages in using currency as a data type, instead numeric or double? Apart from output format with the currency sign?
>
>Internally, a currency value is a 64-bit integer which just gets divided by 10000 when used. So any computation with it should be a lot faster than the usual IEEE format floating numbers. It's perfect for financial apps where you may have a long computation.
>
>Other than that - you may need to check your computation for potential errors; when computing anything that includes division by numbers between -1 and 1 you may be better off by using regular IEEE numbers - they may not be as fast, but they maintain a 15 digits mantissa. If you're not sure when and where will VFP internally convert from currency to IEEE and back, you may consider using ntom() and mton() functions to enforce your own order.
>
>BTW, just heard your new president on the radio. She surely sounds good.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only