On 4/26/09 9:57 PM, "Ruslan Zasukhin" <[email protected]> wrote:

Hi REAL,
Hi Geoff,
 
I want once again point on PROBLEM I see in work with Arrays from plugins.
Also I wonder if the same problem lives inside of RB.

PROBLEM is very bad performance.

1) if we use REALobjectArray then we have only way extract items of variants
using
    REALGetPropValue()

    but as Apple Shark show easy ‹ this means that RB calls PARSER yylex
    on EACH such call.

    it is obvious that this is SLOW.

    I THINK that much better way will be add into PLUGIN SDK
    few methods to GET/SET different types of VARIANT values:

        GetInt16()        SetInt16()
        ...
        GetDouble()     SetDouble
        ...

As result we will get VERY FAST to variant values.

Again, right now REALObjectArray is very slow.
It is slower of REALstringArray in about 10 times (!!!)
Although expected to be 4-5 times FASTER of REALstringArray,
Because no string conversions when work with numbers...

Big Performance speed up possible here :-)


2) REALstringArray  -- here also I see odd things.

In particular when I have run test under Shark / Malloc watching,
It show that internally REALBasic do ‹ wow ­ conversions
of Doubles and Ints into strings.

Why this happens? I just cannot understand it,
Because in RB code I have really create array of STRINGs
And did assign STRINGs ...



-------------------------------------------------------------------------
> This is from shark.
> 
> Work of VARIANT is very slow.
> Tested with RB 2009, but I have see this yet in RB 2005 I believe.
> 
> 
>     0.0%    80.2%    V4RB.rbx_0.dylib
REALGetPropValue(REALobjectStruct*, char const*, long*)
>     0.4%    80.0%    rbframework.dylib        REALGetPropValueInt
>     0.6%    69.0%    rbframework.dylib        REALLoadObjectMethod
>     0.1%    62.3%    rbframework.dylib
BuildClassEvent(ObjectDefinition*, REALevent*)
>     0.9%    61.2%    rbframework.dylib        REALSetPropValueCFStringRef
>     0.1%    50.4%    rbframework.dylib        yylex()
>     2.9%    50.1%    rbframework.dylib        yylex_ex()
>     1.1%    15.8%    rbframework.dylib        string::ConstructFromBuffer(char
const*, unsigned long)
>     1.5%    12.7%    rbframework.dylib        string::AllocateBuffer(unsigned
long, void* (*)(unsigned long))
>     0.7%    11.0%    libSystem.B.dylib          malloc
>     0.6%    10.2%    libSystem.B.dylib          malloc_zone_malloc
>     2.9%    9.7%    libSystem.B.dylib            szone_malloc
>     3.6%    4.8%    libSystem.B.dylib            tiny_malloc_from_free_list
>     1.3%    1.3%    libSystem.B.dylib            tiny_free_list_add_ptr
>     1.5%    1.5%    libSystem.B.dylib             __spin_lock
>     0.2%    0.2%    libSystem.B.dylib             dyld_stub__spin_lock
>     0.1%    0.1%    libSystem.B.dylib             spin_unlock
>     0.1%    0.1%    libSystem.B.dylib             dyld_stub__spin_unlock
>     0.1%    0.1%    libSystem.B.dylib             spin_lock
>     0.0%    0.0%    libSystem.B.dylib            tiny_free_list_add_ptr
>     0.1%    0.1%    libSystem.B.dylib            dyld_stub_malloc_zone_malloc
>     0.0%    0.0%    libSystem.B.dylib            szone_malloc
>     0.1%    0.1%    rbframework.dylib          dyld_stub_malloc
>     0.3%    2.0%    rbframework.dylib         umemcpy(void*, void const*,
unsigned long)
>     0.0%    0.0%    libSystem.B.dylib            __memcpy
>     0.7%    14.9%    rbframework.dylib        stringStorage::RemoveReference()


-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to