Re: [flexcoders] Horrible performance problems...Need some ideas on improving
There are a few places within the ADG code where the code loops over every single item renderer and needlessly (or at least excessively) calls validateNow() on each renderer. That forces the renderers to each relayout and draw themselves and does not allow the delayed layout processing that the framework is supposed to allow. See the updateDisplayOfItemRenderer() method in AdvancedDataGridBase and you'll find this function: protected function updateDisplayOfItemRenderer(r:IListItemRenderer):void { if (r is IInvalidating) { var ui:IInvalidating = IInvalidating(r); ui.invalidateDisplayList(); ui.validateNow(); } } that gets run waaay too often. Also see the drawCellItem() method of AdvancedDataGrid, which down at the bottom of the method has this call: if (item is IFlexDisplayObject) { if (item is IInvalidating) { IInvalidating(item).invalidateDisplayList(); IInvalidating(item).validateNow(); } } So basically every time your data grid is redrawing itself it takes way longer than it should. I created an extended version of ADG and overrode those two methods (had to copy/paste most of the drawCellItem method) and I removed the calls to validateNow, seemed to speed things up a lot. Doug On Thu, Sep 4, 2008 at 8:06 AM, Adrian Williams [EMAIL PROTECTED]wrote: All, I am seeing some incredible lag while using a couple of simple panels and a complex ADG. While I love the flexibility and power of Flex/AS and the ADG, I really need to overcome these performance problems or the project will sink. My ADG has approx. 100 columns with approx. 200 rows, in a grouping collection that contains approx 30 groups. I suspect the lag I am seeing has to do with the redrawing of the rows. Whenever I scroll or collapse/expand the nodes, it takes between 1/2 to 1 second for the action to complete. And this isn't even a very large dataset...we have some that have a few thousand rows. I haven't used any item rendering (yet) that would slow the speed down, though I have two columns that have style functions attached. All in all, this is about as close to display the raw data as I can get. I have spent some time with the profiler and performance monitor and it appears the the code is sound and without memory leaks. I have also gone thru to refactor poorly designed code and remove unnecessary nestings. So my initial questions with this admittedly somewhat vague problem are: 1.) Is there a way to turn off the animations and would doing so help with the speed? 2.) Has anyone else faced this same dilemma and how did you overcome the problems? Thanks, Adrian
Re: [flexcoders] Horrible performance problems...Need some ideas on improving
Hi Doug, This makes sense. It's staggering that the validateNow() is being called basically on every cell In hope of avoiding recreating the wheel, would you be willing to share your extended code with me so I can give it a whirl and see if it remedies the problem? Thanks! Adrian Doug McCune wrote: There are a few places within the ADG code where the code loops over every single item renderer and needlessly (or at least excessively) calls validateNow() on each renderer. That forces the renderers to each relayout and draw themselves and does not allow the delayed layout processing that the framework is supposed to allow. See the updateDisplayOfItemRenderer() method in AdvancedDataGridBase and you'll find this function: protected function updateDisplayOfItemRenderer(r:IListItemRenderer):void { if (r is IInvalidating) { var ui:IInvalidating = IInvalidating(r); ui.invalidateDisplayList(); ui.validateNow(); } } that gets run waaay too often. Also see the drawCellItem() method of AdvancedDataGrid, which down at the bottom of the method has this call: if (item is IFlexDisplayObject) { if (item is IInvalidating) { IInvalidating(item).invalidateDisplayList(); IInvalidating(item).validateNow(); } } So basically every time your data grid is redrawing itself it takes way longer than it should. I created an extended version of ADG and overrode those two methods (had to copy/paste most of the drawCellItem method) and I removed the calls to validateNow, seemed to speed things up a lot. Doug On Thu, Sep 4, 2008 at 8:06 AM, Adrian Williams [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: All, I am seeing some incredible lag while using a couple of simple panels and a complex ADG. While I love the flexibility and power of Flex/AS and the ADG, I really need to overcome these performance problems or the project will sink. My ADG has approx. 100 columns with approx. 200 rows, in a grouping collection that contains approx 30 groups. I suspect the lag I am seeing has to do with the redrawing of the rows. Whenever I scroll or collapse/expand the nodes, it takes between 1/2 to 1 second for the action to complete. And this isn't even a very large dataset...we have some that have a few thousand rows. I haven't used any item rendering (yet) that would slow the speed down, though I have two columns that have style functions attached. All in all, this is about as close to display the raw data as I can get. I have spent some time with the profiler and performance monitor and it appears the the code is sound and without memory leaks. I have also gone thru to refactor poorly designed code and remove unnecessary nestings. So my initial questions with this admittedly somewhat vague problem are: 1.) Is there a way to turn off the animations and would doing so help with the speed? 2.) Has anyone else faced this same dilemma and how did you overcome the problems? Thanks, Adrian
Re: [flexcoders] Horrible performance problems...Need some ideas on improving
the class has a bunch of other stuff in it too (we needed some further display customization), but it's pretty straightforward. The updateDisplayOfItemRenderer method was overriden like so: override protected function updateDisplayOfItemRenderer(r:IListItemRenderer):void { if (r is IInvalidating) { var ui:IInvalidating = IInvalidating(r); ui.invalidateDisplayList(); //dear Flex team in India: I hate you. // ui.validateNow(); } } and then I copied/pasted the entire drawCellItem() method and commented out the call to validateNow() that occurs in the lower part of that function. Give that a whirl and let me know if it helps with performance. Doug On Thu, Sep 4, 2008 at 8:46 AM, Adrian Williams [EMAIL PROTECTED]wrote: Hi Doug, This makes sense. It's staggering that the validateNow() is being called basically on every cell In hope of avoiding recreating the wheel, would you be willing to share your extended code with me so I can give it a whirl and see if it remedies the problem? Thanks! Adrian Doug McCune wrote: There are a few places within the ADG code where the code loops over every single item renderer and needlessly (or at least excessively) calls validateNow() on each renderer. That forces the renderers to each relayout and draw themselves and does not allow the delayed layout processing that the framework is supposed to allow. See the updateDisplayOfItemRenderer() method in AdvancedDataGridBase and you'll find this function: protected function updateDisplayOfItemRenderer(r:IListItemRenderer):void { if (r is IInvalidating) { var ui:IInvalidating = IInvalidating(r); ui.invalidateDisplayList(); ui.validateNow(); } } that gets run waaay too often. Also see the drawCellItem() method of AdvancedDataGrid, which down at the bottom of the method has this call: if (item is IFlexDisplayObject) { if (item is IInvalidating) { IInvalidating(item).invalidateDisplayList(); IInvalidating(item).validateNow(); } } So basically every time your data grid is redrawing itself it takes way longer than it should. I created an extended version of ADG and overrode those two methods (had to copy/paste most of the drawCellItem method) and I removed the calls to validateNow, seemed to speed things up a lot. Doug On Thu, Sep 4, 2008 at 8:06 AM, Adrian Williams [EMAIL PROTECTED] wrote: All, I am seeing some incredible lag while using a couple of simple panels and a complex ADG. While I love the flexibility and power of Flex/AS and the ADG, I really need to overcome these performance problems or the project will sink. My ADG has approx. 100 columns with approx. 200 rows, in a grouping collection that contains approx 30 groups. I suspect the lag I am seeing has to do with the redrawing of the rows. Whenever I scroll or collapse/expand the nodes, it takes between 1/2 to 1 second for the action to complete. And this isn't even a very large dataset...we have some that have a few thousand rows. I haven't used any item rendering (yet) that would slow the speed down, though I have two columns that have style functions attached. All in all, this is about as close to display the raw data as I can get. I have spent some time with the profiler and performance monitor and it appears the the code is sound and without memory leaks. I have also gone thru to refactor poorly designed code and remove unnecessary nestings. So my initial questions with this admittedly somewhat vague problem are: 1.) Is there a way to turn off the animations and would doing so help with the speed? 2.) Has anyone else faced this same dilemma and how did you overcome the problems? Thanks, Adrian
Re: [flexcoders] Horrible performance problems...Need some ideas on improving
heh, my bad about the comments in that block of code, I copied and pasted without really reading :) To be diplomatic let's just say I have complex emotions when it comes to the work that was done on the ADG, and that I don't in fact hate anyone anywhere in the world. On Thu, Sep 4, 2008 at 8:51 AM, Doug McCune [EMAIL PROTECTED] wrote: the class has a bunch of other stuff in it too (we needed some further display customization), but it's pretty straightforward. The updateDisplayOfItemRenderer method was overriden like so: override protected function updateDisplayOfItemRenderer(r:IListItemRenderer):void { if (r is IInvalidating) { var ui:IInvalidating = IInvalidating(r); ui.invalidateDisplayList(); //dear Flex team in India: I hate you. // ui.validateNow(); } } and then I copied/pasted the entire drawCellItem() method and commented out the call to validateNow() that occurs in the lower part of that function. Give that a whirl and let me know if it helps with performance. Doug On Thu, Sep 4, 2008 at 8:46 AM, Adrian Williams [EMAIL PROTECTED] wrote: Hi Doug, This makes sense. It's staggering that the validateNow() is being called basically on every cell In hope of avoiding recreating the wheel, would you be willing to share your extended code with me so I can give it a whirl and see if it remedies the problem? Thanks! Adrian Doug McCune wrote: There are a few places within the ADG code where the code loops over every single item renderer and needlessly (or at least excessively) calls validateNow() on each renderer. That forces the renderers to each relayout and draw themselves and does not allow the delayed layout processing that the framework is supposed to allow. See the updateDisplayOfItemRenderer() method in AdvancedDataGridBase and you'll find this function: protected function updateDisplayOfItemRenderer(r:IListItemRenderer):void { if (r is IInvalidating) { var ui:IInvalidating = IInvalidating(r); ui.invalidateDisplayList(); ui.validateNow(); } } that gets run waaay too often. Also see the drawCellItem() method of AdvancedDataGrid, which down at the bottom of the method has this call: if (item is IFlexDisplayObject) { if (item is IInvalidating) { IInvalidating(item).invalidateDisplayList(); IInvalidating(item).validateNow(); } } So basically every time your data grid is redrawing itself it takes way longer than it should. I created an extended version of ADG and overrode those two methods (had to copy/paste most of the drawCellItem method) and I removed the calls to validateNow, seemed to speed things up a lot. Doug On Thu, Sep 4, 2008 at 8:06 AM, Adrian Williams [EMAIL PROTECTED] wrote: All, I am seeing some incredible lag while using a couple of simple panels and a complex ADG. While I love the flexibility and power of Flex/AS and the ADG, I really need to overcome these performance problems or the project will sink. My ADG has approx. 100 columns with approx. 200 rows, in a grouping collection that contains approx 30 groups. I suspect the lag I am seeing has to do with the redrawing of the rows. Whenever I scroll or collapse/expand the nodes, it takes between 1/2 to 1 second for the action to complete. And this isn't even a very large dataset...we have some that have a few thousand rows. I haven't used any item rendering (yet) that would slow the speed down, though I have two columns that have style functions attached. All in all, this is about as close to display the raw data as I can get. I have spent some time with the profiler and performance monitor and it appears the the code is sound and without memory leaks. I have also gone thru to refactor poorly designed code and remove unnecessary nestings. So my initial questions with this admittedly somewhat vague problem are: 1.) Is there a way to turn off the animations and would doing so help with the speed? 2.) Has anyone else faced this same dilemma and how did you overcome the problems? Thanks, Adrian
Re: [flexcoders] Horrible performance problems...Need some ideas on improving
On Thursday 04 Sep 2008, Adrian Williams wrote: My ADG has approx. 100 columns with approx. 200 rows, I wouldn't consider a 100 row DataGrid a very good user experience, in the general case, so maybe you could redo the GUI. Probably not the quickest fix :-) -- Tom Chiverton This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB. A list of members is available for inspection at the registered office. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. Regulated by The Solicitors Regulation Authority. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 2500. For more information about Halliwells LLP visit www.halliwells.com. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * Your email settings: Individual Email | Traditional * To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) * To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [flexcoders] Horrible performance problems...Need some ideas on improving
Doug, Any component developer that has created and/or extends/maintains this framework knows you really meant; override protected function updateDisplayOfItemRenderer(r:IListItemRenderer):void { if (r is IInvalidating) { var ui:IInvalidating = IInvalidating(r); ui.invalidateDisplayList(); *//dear validateNow() : I hate you.* // ui.validateNow(); } } Mike _ -- Teoti Graphix, LLC http://www.teotigraphix.com Teoti Graphix Blog http://www.blog.teotigraphix.com You can find more by solving the problem then by 'asking the question'.
Re: [flexcoders] Horrible performance problems...Need some ideas on improving
Hi Tom, Under normal circumstances, I would tend to agree...however, it's our users that are demanding the data...in a nutshell, we are displaying genetic DNA data and the columns are pertinent to the work our users are doing. The 100 columns are genetic markers and the row is a test sample with the information for each genetic marker. Adrian Tom Chiverton wrote: On Thursday 04 Sep 2008, Adrian Williams wrote: My ADG has approx. 100 columns with approx. 200 rows, I wouldn't consider a 100 row DataGrid a very good user experience, in the general case, so maybe you could redo the GUI. Probably not the quickest fix :-)
Re: [flexcoders] Horrible performance problems...Need some ideas on improving
These markers are graphic? http://en.wikipedia.org/wiki/Restriction_fragment_length_polymorphism If so, couldn't you use the drawing API maybe in a ItemRenderer for a List? Much lighter than a DG and certainly far lighter then ADG. DK On Thu, Sep 4, 2008 at 12:21 PM, Adrian Williams [EMAIL PROTECTED]wrote: Hi Tom, Under normal circumstances, I would tend to agree...however, it's our users that are demanding the data...in a nutshell, we are displaying genetic DNA data and the columns are pertinent to the work our users are doing. The 100 columns are genetic markers and the row is a test sample with the information for each genetic marker. Adrian Tom Chiverton wrote: On Thursday 04 Sep 2008, Adrian Williams wrote: My ADG has approx. 100 columns with approx. 200 rows, I wouldn't consider a 100 row DataGrid a very good user experience, in the general case, so maybe you could redo the GUI. Probably not the quickest fix :-) -- Douglas Knudsen http://www.cubicleman.com this is my signature, like it?
Re: [flexcoders] Horrible performance problems...Need some ideas on improving
Hi Doug, No, they are not graphical...static int data...here is a good wiki for what we are doingthe columns in my ADG are the DYS markers and the data for each row comes from the alleles (which in the wiki table are the valid range, e.g. DYS390 has an allelic value between 17 and 28). http://en.wikipedia.org/wiki/List_of_DYS_markers I am not using any graphics at all in the table. It is literally all plain ol' data. All of the numbers are stored in the DB and I am simply taking the data from the table in the db and displaying in a table on my presentation layer. Adrian Douglas Knudsen wrote: These markers are graphic? http://en.wikipedia.org/wiki/Restriction_fragment_length_polymorphism http://en.wikipedia.org/wiki/Restriction_fragment_length_polymorphism If so, couldn't you use the drawing API maybe in a ItemRenderer for a List? Much lighter than a DG and certainly far lighter then ADG. DK On Thu, Sep 4, 2008 at 12:21 PM, Adrian Williams [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi Tom, Under normal circumstances, I would tend to agree...however, it's our users that are demanding the data...in a nutshell, we are displaying genetic DNA data and the columns are pertinent to the work our users are doing. The 100 columns are genetic markers and the row is a test sample with the information for each genetic marker. Adrian Tom Chiverton wrote: On Thursday 04 Sep 2008, Adrian Williams wrote: My ADG has approx. 100 columns with approx. 200 rows, I wouldn't consider a 100 row DataGrid a very good user experience, in the general case, so maybe you could redo the GUI. Probably not the quickest fix :-) -- Douglas Knudsen http://www.cubicleman.com http://www.cubicleman.com this is my signature, like it?