[V4MD:TEST] Results

Ruslan Zasukhin sunshine at public.kherson.ua
Mon Aug 30 19:50:25 CDT 2004


On 8/30/04 7:36 PM, "Ruslan Zasukhin" <sunshine at public.kherson.ua> wrote:

> 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()

Igor, don't you think that it is possible to make hack here?!

1) V4MD is single-thread. Always.

2) so we can prepare

    a) one Vtable object which live long time
    b) one VField object which live long time

Just assign to them I_Table* or I_Field*
And return them as result?

No, this will not works :-(
Because we cannot differ if user have made it as tmp object
Or he have store reference to this object...

------
Well, have you investigate if something can be improved in e.g. Xtra
creation?

May be we cache some pointers to interfaces?
So next time we will use cached values instead of QueryInterface() ?

Ok, this is not the main target now Igor.
Just keep in mind that later we can think here for optimization.


>> 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