Scott is correct.  However, horizontal scrolling is not optimized in the
DG so it will never perform as well as vertical scrolling.

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Scott Melby
Sent: Friday, January 11, 2008 6:31 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Dynamic DataGrid + slow horizontal scrolling

 

Gary - 

Pretty much Every time I see datagrid performance issues it is due to 1
of the following 2 issues.

1) Heavy renderers (HBox VBox, etc,) - This is not the case for you
application since you are just using the standard renderer.

2) Inefficient data source - I believe this is the case for your
application.  When you bind directly to e4x in an XMLListCollection your
renderers (each column) have to re-parse that data from the e4x
attribute each time they are called.

The first thing I would suggest doing is creating an AS object that
represents each row of your data.  That object can have an attribute for
each column (XML attr that you are displaying).  In your dataHandler()
method you can parse the e4x XML ONCE and construct a new AS object for
each row, stick them in an ArrayCollection and bind your grid to that.
The grid renderers will then be bound to pre-parsed data and will have
to do a lot less work.  This also happens to utilize memory much more
efficiently (I believe e4x allocates a small chunk of memory on each
parse).  The e4x allocated memory does get cleaned up (I believe Alex
said it does).  But, it is not cheap to allocate tons of small chunks
and clean them up repeatedly.

hth
Scott

Scott Melby
Founder, Fast Lane Software LLC
http://www.fastlanesw.com <http://www.fastlanesw.com> 



Gary Smith wrote: 


Can anyone explain why this datagrid is so slow at horizontal scrolling:

source and demo here: it takes a few seconds to start over the internet
due
to large number of columns being generated dynamically out from the xml
source

http://www.smithkjaer.dk/flex/TestComp.html
<http://www.smithkjaer.dk/flex/TestComp.html> 

Note: If I disable the datagrids scrolling and scroll it in a canvas
there
is no performance problem when scrolling, except i miss my column header
labels when vertical scrolling is used.
-- 
View this message in context:
http://www.nabble.com/Dynamic-DataGrid-%2B-slow-horizontal-scrolling-tp1
4731055p14731055.html
<http://www.nabble.com/Dynamic-DataGrid-%2B-slow-horizontal-scrolling-tp
14731055p14731055.html> 
Sent from the FlexCoders mailing list archive at Nabble.com.

 

Reply via email to