Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
New WEEKDAYS function.
Message
From
22/08/2003 14:12:39
Walter Meester
HoogkarspelNetherlands
 
 
To
22/08/2003 12:09:46
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00821896
Message ID:
00822707
Views:
34
Hi mike,

>Yippee! Hopefully this means you're hooked. You only have to put the m. when the content of the variable is being interrogated. IOW, not when you are assigning content to the variable. http://fox.wikis.com/wc.dll?Wiki~EssentialMDot~VFP.

Well, I see there might be a performance hit when having an workarea selected with lots of fields in it. However on my P4 2Ghz the sample beneath had a 0.170 difference in 100.000 iterations with 3 assigmentlines when I used the m. prefix. Now I used a fairly wide table of 129 fields. When using tables of lets say 10 fields the difference is surely measurable but with 0.016 seconds not significant (0.125 and 0.141).

For me,in itself the performance advantage of using m. is not enough reason to use it permanently. (I really don't like the m. for readability reasons). However this will be in my book of tricks to boost performance a bit and I'll use it when neccesary.

Walter,


>If you use it during assignments there will be a performance hit. That may be what you remembered when you said it was slower. Using them properly has never been slower in my experience. Check this to see if it is faster.
>
>
nSec=SECONDS()
>>nX = 1
>>nZ = 0
>>FOR nT = 1 TO 100000
>>	nX = m.nX + 1
>>	nY = m.nZ
>>	nZ = m.nX
>>ENDFOR
>
>>Hi Mike,
>>
>>>Are you aware that with a table open, your routine will run slower than with no table open? In fact, the more fields, the slower it will go?
>>
>>I was suprised to see that you're totally right and the performance difference is indeed significant when having a table open with large numbers of fields. In my case the performance indeed was more than two times as slow when having a table selected with large numbers of fields.
>>
>>
>>USE SometableWithLargeAmountsOfFields
>>
>>m.nSec=SECONDS()
>>m.nX = 1
>>m.nZ = 0
>>FOR m.nT = 1 TO 100000
>>	m.nX = m.nX +1
>>	m.nY = m.nZ
>>	m.nZ = m.nX
>>ENDFOR
>>
>>WAIT WINDOW STR(SECONDS() - nSec,6,3)
>>
>>nSec=SECONDS()
>>nX = 1
>>nZ = 0
>>FOR nT = 1 TO 100000
>>	nX = nX +1
>>	nY = nZ
>>	nZ = nX
>>ENDFOR
>>
>>WAIT WINDOW STR(SECONDS() - nSec,6,3)
>>
>>
>>
>>Thanks,
>>
>>Walter,
Previous
Reply
Map
View

Click here to load this message in the networking platform