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" <[email protected]> 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 <[email protected]>
>Gesendet: Dienstag, 2. August 2016 07:24:17
>An: [email protected]
>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.