You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Justin Mclean <ju...@classsoftware.com> on 2012/03/07 04:32:52 UTC

Too much validation occurring in AdvancedDataGrid

Hi,

Is a bit quiet around here so I thought I bring up something odd I found a while ago.

If you run the sample found here on the whiteboard:

http://svn.apache.org/viewvc/incubator/flex/whiteboard/jmclean/datagrid/src/TooMuchValidation.mxml

and move the mouse about you'll see how many times validiateNow is being called for each cell.

If you move sideways cell to cell you sell that each cell is the row is validated twice and the first cell 4 times

If you move up or down a row you'll see that each cell in both rows are validated and the first cells twice.

Obviously this could be optimised. With large datagrids (and custom item renderers) this slows down things a little.

So a few questions:

Why is the first cell in each row being validated more than once? (I've not worked this out so far).

One of the validateNow is being called from drawItem in AdvancedList Base (line 4800 or so) like so:

        if (item is IFlexDisplayObject)
        {
            if (item is IInvalidating)
            {
                IInvalidating(item).invalidateDisplayList();
                IInvalidating(item).validateNow();
            }
        }


Do we need to call invalidateDisplayList as validateNow would also call updateDisplayList right? As no properties are changed on the item (as far as I can tell) I'm not even sure we need to call validateNow at all perhaps just invalidateDisplayList is enough? Does drawItem need to called at all for the entire row if moving mouse over cell left or right?

Hopefully someone else has encountered into this issue and/or can cast some more light on it.

This is not as far as I know an existing issue reported in the Adobe bug base.

Thanks,
Justin

Re: Too much validation occurring in AdvancedDataGrid

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> If you are interested in looking at this, I think we have several dozen unsorted fixes to the ADG over the years.
Sure send them my way.

I also have about a dozen probably some overlap. Most of mine have been documented in the existing Adobe bug base so just waiting until JIRA is sorted out before submitting/commenting on them.

Thanks,
Justin



RE: Too much validation occurring in AdvancedDataGrid

Posted by "Michael A. Labriola" <la...@digitalprimates.net>.
Justin,

If you are interested in looking at this, I think we have several dozen unsorted fixes to the ADG over the years. I planned on going through them all one by one, trying to document the root cause of each, etc.... however, if you want to accelerate that process I would be glad to give them to you wholesale :)

Mike

Re: Too much validation occurring in AdvancedDataGrid

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> Did you try the same scenario with the Spark DataGrid?
Just have and it also has issues  (on start first cell is validated 7 times and every other cell twice). It's different issues to the mx ADG but I guess that's is to be expected.

I've added a sample to the whiteboard if you want to take a look.

>  More performance work has been done on that since it was suppose to replace
> mx:AdvancedDataGrid.
That great if you can use it. Until the spark datagrid is feature complete many projects have no choice but to use the ADG datagrid. If you're working with an existing code base it can be a lot of work to convert mx:ADG code to s:DG.

Thanks,
Justin

Re: Too much validation occurring in AdvancedDataGrid

Posted by Carol Frampton <cf...@adobe.com>.
Did you try the same scenario with the Spark DataGrid?  More performance
work has been done on that since it was suppose to replace
mx:AdvancedDataGrid.

Carol

On 3/6/12 10 :32PM, "Justin Mclean" <ju...@classsoftware.com> wrote:

>Hi,
>
>Is a bit quiet around here so I thought I bring up something odd I found
>a while ago.
>
>If you run the sample found here on the whiteboard:
>
>http://svn.apache.org/viewvc/incubator/flex/whiteboard/jmclean/datagrid/sr
>c/TooMuchValidation.mxml
>
>and move the mouse about you'll see how many times validiateNow is being
>called for each cell.
>
>If you move sideways cell to cell you sell that each cell is the row is
>validated twice and the first cell 4 times
>
>If you move up or down a row you'll see that each cell in both rows are
>validated and the first cells twice.
>
>Obviously this could be optimised. With large datagrids (and custom item
>renderers) this slows down things a little.
>
>So a few questions:
>
>Why is the first cell in each row being validated more than once? (I've
>not worked this out so far).
>
>One of the validateNow is being called from drawItem in AdvancedList Base
>(line 4800 or so) like so:
>
>        if (item is IFlexDisplayObject)
>        {
>            if (item is IInvalidating)
>            {
>                IInvalidating(item).invalidateDisplayList();
>                IInvalidating(item).validateNow();
>            }
>        }
>
>
>Do we need to call invalidateDisplayList as validateNow would also call
>updateDisplayList right? As no properties are changed on the item (as far
>as I can tell) I'm not even sure we need to call validateNow at all
>perhaps just invalidateDisplayList is enough? Does drawItem need to
>called at all for the entire row if moving mouse over cell left or right?
>
>Hopefully someone else has encountered into this issue and/or can cast
>some more light on it.
>
>This is not as far as I know an existing issue reported in the Adobe bug
>base.
>
>Thanks,
>Justin