[V4MD:TEST] Results
Ruslan Zasukhin
sunshine at public.kherson.ua
Mon Aug 30 19:36:40 CDT 2004
On 8/30/04 6:26 PM, "Igor Gomon" <giv at tlc.kherson.ua> wrote:
> I've made next tests:
>
> (1 time unit is 1/60 second)
>
> -- first
> set startTime to the timer
> repeat with i = 0 to 100000
> f1.getName2() // Usual call of object's method
> end repeat
> set endTime to the timer
> alert "Time taken using child object " & (endTime - startTime)
> -- RESULT: 9
>
> -- second
> set startTime to the timer
> set f1Ref to VTable.getFieldRef(tableRef, "f1")
> repeat with i = 0 to 100000
> f1.getName(f1Ref) // Call of static (class) method. 'this' is passed
> as first parameter.
> end repeat
> set endTime to the timer
> alert "Time taken using object reference " & (endTime - startTime)
> -- RESULT: 9
>
>
> -- third
> set table1 to gDb.getTableXtra("Table1")
> set startTime to the timer
> repeat with i = 0 to 100000
> // Using dot-syntax. Each time temporary VField Xtra is created
> // and then destroyed.
> table1.getFieldXtra("f1").getName2()
> end repeat
> set endTime to the timer
> -- RESULT: 230
>
> (In tests function getName() & getName2() does the same
> but getName() is static & getName2() not).
>
> So,
> I think that we have no strong reasons not to use child objects.
> What do you think?
Well, of course it is 20 times slower, but looks much much better and
logical.
Add one more test:
fld = table1.getFieldXtra("f1").
loop
{
fld.getName2()
}
I think in this case we can get much better results!
The same is true for REALbasic for example.
It is common RULE:
if move from loop something then loop will be faster.
So test and give us results.
-------------
Also why you use such names?
getTableXtra() ?
This should be like in realbasic
gDB.Table("T").Field("f") = 5
--
Best regards,
Ruslan Zasukhin [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com
To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------
More information about the Valentina-beta
mailing list