Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using a variable to store an object name
Message
From
06/06/1997 09:51:22
 
 
To
05/06/1997 20:33:44
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00035059
Message ID:
00035380
Views:
49
>>> Thisform.&cObjectname..property=...). Therefore I like macros and I would
>>
>>> really appreciate to get some bench test numbers comparing speed.
>
>Mr. Pikman:
>I normally don't critique code, but this is particularly bad (not to mention inefficient) from an object-oriented point of view. There are way that this can be done that are much more in line with the OOP paradigm and don't involve macros.
>
>>Check this out :
>>
>>I run this code :
>>
>>*-------
>>lvarname='vn'
>>
>>start = seconds()
>>for x=1 to 10000
>> store 'test' to &lvarname
>>endfor
>>?seconds() - start
>>
>>start = seconds()
>>for x=1 to 10000
>> store 'test' to (lvarname)
>>endfor
>>?seconds() - start
>>*---------
>>
>>First loop = 4.426 sec
>>Second loop = 1.142 sec
>
>Mr. Varzura:
>Thank you for this demonstration. It's simple and clear.

Dear Mr. Stowell,

I rarely reply on unimportant messages, but I have to reply now because you explicitly mentioned my name.
I kindly appreciate the example, and congratulate you getting 3 sec on 10000 recs loop (I am wondering who are using so 'high-volume' loops). Plainly speaking there are three things which really affect VFP app performance:
1. Data model
2. Rushmore optimization
3. App logics
These things can affect performance in terms of minutes or hours. Other things, like one you discussed, will gain microseconds. So you can figure out where to spent time for better results.

Sincerely yours
Edward Pikman
Independent Consultant
Previous
Reply
Map
View

Click here to load this message in the networking platform