flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jude <flexcapaci...@gmail.com>
Subject Re: AW: Workers and Speed
Date Tue, 02 Aug 2016 07:26:45 GMT
If you're using object proxies or viable objects for bindings specifically
for use in ItemRenderers that could be taking plenty of time as well.

Instead, override the set data function of the Item Renderer and set the
component properties directly and do not use binding tags in the MXML.

Example:

myLabel.text = data.myProperty;

versus:

<s:Label text="{data.myPrperty}" />

P.S. How are you able to run a function that long? Script timeout limit max
is set for one minute.

See
http://help.adobe.com/en_US/flex/using/WS77c1dbb1bd80d3836ecbb5ec129ec77b1e1-8000.html#WS5ED0A932-BA59-4a77-9A9D-3745FE21D1E9

On Aug 2, 2016 1:46 AM, "Alex Harui" <aharui@adobe.com> wrote:

That makes me want to ask a potentially important question:  Does this
data need to be bindable in the first place?  Is MXML data binding being
used on the data and/or are any of the properties in the data being
changed and change events are needed?

If not, then even using [Bindable] may not be necessary.

Roughly speaking, if you have:

public class Data
{
  public var field:int;
}

Then accessing the field variable is a simple and very fast memory lookup.

But if you use [Bindable] then accessing the field variable essentially
calls a function to get the value.

function get field():int {
  return _field;
}

And if you use ObjectProxy, then accessing field runs all of this code:

override flash_proxy function getProperty(name:*):*
    {
        // if we have a data proxy for this then
        var result:*;

        if (notifiers[name.toString()])
            return notifiers[name];

        result = _item[name];

        if (result)
        {
            if (_proxyLevel == 0 || ObjectUtil.isSimple(result))
            {
                return result;
            }
            else
            {
                result = object_proxy::getComplexProperty(name, result);
            } // if we are proxying
        }

        return result;
    }


In some cases, it might be faster to convert from data objects that have
[Bindable] to data objects of all vars. YMMV.

HTH,
-Alex

On 8/1/16, 11:31 PM, "Christofer Dutz" <christofer.dutz@c-ware.de> wrote:

>Well the optimizations I did in order to get my applications to speed up
>dramatically were on the one side using Arrays instead of collections.
>The biggest thing I noticed were, that per default my model classes were
>annotated with [Bindable], which caused every property to be bindable. By
>explicitly handing the events and not relying on a bindable model, I cut
>the overhead by 9/10th ... could check this (Have to admit that I haven't
>read all of this lengthy thread though ... so if I'm suggesting something
>that's already been suggested ... sorry for that ;-) )
>
>
>Chris
>
>________________________________
>Von: bilbosax <waspence41@comcast.net>
>Gesendet: Dienstag, 2. August 2016 07:24:17
>An: users@flex.apache.org
>Betreff: Re: Workers and Speed
>
>Alright!!!  Now we are getting somewhere! Passing the ArrayCollection to a
>standard Array cut the time in Half!  From almost 50 minutes down to 23
>minutes.  So here is the breakdown now:
>
>Total time = 1396 sec
>ObjectProxy.getProperty --> 804 sec
>Garbarge Collection --> 198 sec
>ObjectProxy.setProperty --> 25 sec
>(times related to the ArrayCollection previously are gone!)
>
>I wish there was a way to get rid of some of that ObjectProxy time.
>Regardless of it is is an object or an objectproxy or a bindable named
>class, there is still going to be some time involved in plucking the data
>out of the array to work on.  I don't know how severe of a penalty it is
>that the data is inside of an ObjectProxy.  But I also don't understand
>how
>to use the bindable named class either.
>
>The way that it works is I am reading ALL of the data from a database
>(SELECT * FROM main), and making the results the source of my
>mainArrayCollection that displays in my datagrid and is used in all of my
>calculations.  I don't know how to go about taking that data and assigning
>it to a bindable class.  Taking each object and converting it to an
>objectproxy was a really easy process.  If you think that it would help my
>speed problems, could you help me to understand how to use this bindable
>class that you and Alex have referred to?
>
>Thanks for all of your help!!!  I've gone from over 2 hours down to 23
>minutes!
>
>
>
>
>
>
>--
>View this message in context:
>http://apache-flex-users.2333346.n4.nabble.com/Workers-and-Speed-tp13098p1
>3140.html
>Sent from the Apache Flex Users mailing list archive at Nabble.com.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message