You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by bilbosax <wa...@comcast.net> on 2016/07/23 02:51:35 UTC

Why are Spark Datagrid headers sorting my data so slowly in Air?

I wrote an AIR program two different ways, one using a Spark Datagrid and
another using the older MX Datagrid. I currently have 40k records displaying
in the datagrid and the end user is going to want to sort the data by
clicking on the table headers. When I used the older MX version, the sorts
happened fairly quickly, I was really surprised. But the Spark version is so
incredibly slow, sometimes taking up to a minute to sort the data and
locking up the program until it is complete. I am not doing anything really
complicated with item renderers. I have one that just displays a tiny
picture icon, and another that formats an integer into money using a
currency Formatter. I ended up needing to use the Spark Datagrid for
presentation purposes. Any idea why the sorting is happening so slowly, and
are you aware of any workarounds to make the sorting on the headers faster?
Thanks!



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Why-are-Spark-Datagrid-headers-sorting-my-data-so-slowly-in-Air-tp13026.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Why are Spark Datagrid headers sorting my data so slowly in Air?

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

> If Justin has time, I'd be curious to see results of using ObjectProxy
> instead of Object in the tests he ran.

A quick test showed ObjectProxy to be twice as slow as Object with a minimal spark Datagrid same setup as before.

Thanks,
Justin

Re: Why are Spark Datagrid headers sorting my data so slowly in Air?

Posted by Alex Harui <ah...@adobe.com>.
Top posting to try to collect replies in one post...

Looks like it might be possible to create subclasses of GridColumn that
return regular SortFields.  The key is to explicitly provide the DataGrid
with an ArrayList of your GridColumn subclasses so it doesn't go and
generate its own.  Then you might be able to get better sorting without
having to resort to sorting outside of the DataGrid.  Not sure if that
will be less work or not.

If Justin has time, I'd be curious to see results of using ObjectProxy
instead of Object in the tests he ran.  In my experience, ObjectProxy can
be noticeably slow.

Maybe Mihai, who has been in this area of the code, will find some time to
tune it up for a future release.

HTH,
-Alex

On 7/25/16, 12:54 AM, "Justin Mclean" <ju...@classsoftware.com> wrote:

>Hi,
>
>> Well, just out of curiosity, I decided to put the currencyFormatters and
>> Filters back in, and then I created two buttons and two button handlers
>>that
>> would sort my arrayCollection both ascending and decending outside of
>>the
>> datagrid and then refresh the datagrid, and about fell out of my chair.
>
>Yes that would be faster as it’s not using the Spark data grid sorting
>code but basically using the same code the mx datagrid uses in the
>default case (i.e. what's in ListCollectionView).
>
>>  and write 52 sorting routines for ascending and descending.
>
>It likely those methods can be reused for similar columns so probably not
>quite not quite that many as you think may be needed.
>
>> By the way, you may want to give a heads up to the team on the sorting
>>of
>> large datasets on a spark datagrid.  It isn't pretty.
>
>Both Alex and I are on the team, however given there workarounds and
>volunteer time is limited it may r may not get looked at. It may be a
>good idea to raise a JIRA [1] so the issue is not forgotten about, other
>people can easily find it if they run into it.
>
>Thanks,
>Justin
>
>1. https://issues.apache.org/jira/browse/FLEX


Re: Why are Spark Datagrid headers sorting my data so slowly in Air?

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

> Well, just out of curiosity, I decided to put the currencyFormatters and
> Filters back in, and then I created two buttons and two button handlers that
> would sort my arrayCollection both ascending and decending outside of the
> datagrid and then refresh the datagrid, and about fell out of my chair.

Yes that would be faster as it’s not using the Spark data grid sorting code but basically using the same code the mx datagrid uses in the default case (i.e. what's in ListCollectionView).

>  and write 52 sorting routines for ascending and descending.  

It likely those methods can be reused for similar columns so probably not quite not quite that many as you think may be needed.

> By the way, you may want to give a heads up to the team on the sorting of
> large datasets on a spark datagrid.  It isn't pretty.

Both Alex and I are on the team, however given there workarounds and volunteer time is limited it may r may not get looked at. It may be a good idea to raise a JIRA [1] so the issue is not forgotten about, other people can easily find it if they run into it.

Thanks,
Justin

1. https://issues.apache.org/jira/browse/FLEX

Re: Why are Spark Datagrid headers sorting my data so slowly in Air?

Posted by bilbosax <wa...@comcast.net>.
Well, just out of curiosity, I decided to put the currencyFormatters and
Filters back in, and then I created two buttons and two button handlers that
would sort my arrayCollection both ascending and decending outside of the
datagrid and then refresh the datagrid, and about fell out of my chair.  The
sorts took less than a second.  Not quite as fast as the mx datagrid sorts,
but definitely usable.  Ugh.  Now I have to figure out how to turn off the
sorting on the headers, figure out how to dispatch an event if a header is
clicked, and write 52 sorting routines for ascending and decending.  Man, I
wish I wasn't so in love with the way a spark datagrid displays :)  HaHa!!

By the way, you may want to give a heads up to the team on the sorting of
large datasets on a spark datagrid.  It isn't pretty.



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Why-are-Spark-Datagrid-headers-sorting-my-data-so-slowly-in-Air-tp13026p13052.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Why are Spark Datagrid headers sorting my data so slowly in Air?

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

> It was so much faster when I was using the mx component.

The MX data grid components have had seen significant optimisation since being donated, with performance increases of 10x-100x times in some operations (depending on what you’re doing) over the Adobe SDK components. There have been some improvements to the Spark data grids but not as significant gains as far as I’m aware.

>  With the filters removed, the currencyformatters removed, and the itemrenders removed, I can't imagine
> what I could do programatically to make this simple application any faster.

The default item renderers and sorting may not be faster in Spark for that amount data.

> So the only question I have left before I give up on the spark datagrid and
> move back to the mx version is, could writing my own sort routines somehow
> run faster than what is built into the spark data grid?

Your own sorting functions are likely to run faster if no formatting etc is involved, however it’s really best to use the profiler/scout to find why your application is being slow.

Thanks,
Justin

Re: Why are Spark Datagrid headers sorting my data so slowly in Air?

Posted by OK <po...@olafkrueger.net>.
I'd only like to mention that Flexicious [1] offers some powerful Flex
datagrids.
It's a commercial product, but the fee is very fair including a great
support from the developers.
The demos looks a bit old school but the product is still awesome.

So if it fits your needs, go for it and support one of the less Flex
companies out there ;-)

Olaf

[1] http://www.flexicious.com/




--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Why-are-Spark-Datagrid-headers-sorting-my-data-so-slowly-in-Air-tp13026p13055.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Why are Spark Datagrid headers sorting my data so slowly in Air?

Posted by bilbosax <wa...@comcast.net>.
I wish I could, but I would not be able to get permission to send you the
company database.  I did figure out that if I did the sorts by writing my
own routines on the arraycollection, the datagrid updates in about a second. 
This is a *enormous* improvement, but leaves me with the task of writing 52
sorting subroutines.  Oh well, it is better than nothing.  At this point, I
can only surmise that the problem is within the sorting routines contained
within the spark datagrid component. That is my 2 cents.



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Why-are-Spark-Datagrid-headers-sorting-my-data-so-slowly-in-Air-tp13026p13053.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Why are Spark Datagrid headers sorting my data so slowly in Air?

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

OK as a quick test I created a default spark data grid with 100,000 rows and ten columns with simple numbers and tried sorting a column, it’s slow about 10 seconds on my machine.

Looking in Scout 30+% of the time is garbage collection in the sort routines and 20+% is the sorting itself, so thats’ where most of the time is going. So as I suspected a lot of it is the temporary objects used by the default sorting algorithms, in particular the code to handle complex fields.

There is however a work around:
- Changing the data grid to use simple custom sort functions changes the sort time to around 1 second and there’s very little garbage collection.
- Changing to use a named class rather than objects improved the performance a little more.

OR alternatively removing the custom sort and using the named data class reduced the column sort time to about 2 seconds (again down for 10 seconds).

Double checking with a mx datagrid by default the performance was significantly faster and usable without any custom sort routines or named classes so I can see there may be an expectation that the spark data grid performs just as well.

The mx datagrid is calling Sort.sort method directly, it may be possible to optimise the spark Datagrid to do this as well. However for large amounts of data the defaults may not going to be the most performant, and given they are coding for all cases rather than a known simple case it's probably not that surprising.

Thanks,
Justin

Re: Why are Spark Datagrid headers sorting my data so slowly in Air?

Posted by OK <po...@olafkrueger.net>.
bilbosax wrote
> So essentially, all I had was an arraycollection with my raw data in it
> displayed in a spark datagrid.  And the sorting was still unbelievably
> slow, 15 to 30 seconds at times with the program completely locking up. 
> I'm using SQLite as the database...

Could you provide a small test case?
I would try to run it on my local machine to see if the issue is
reproducable.

Olaf



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Why-are-Spark-Datagrid-headers-sorting-my-data-so-slowly-in-Air-tp13026p13050.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Why are Spark Datagrid headers sorting my data so slowly in Air?

Posted by bilbosax <wa...@comcast.net>.
Thanks, I really appreciate the input I have recieved.  You suggestion took
care of the descriptor file, but version 4.14.1 did not help. I have taken a
much more caveman approach to trying to solve this because programming is
not my vocation.  I'm simply trying to create a tool that will help us in
our office.  I removed all of the currencyformatters, I removed all of the
itemrenderers, and I removed all of the filters from my program.  So
essentially, all I had was an arraycollection with my raw data in it
displayed in a spark datagrid.  And the sorting was still unbelievably slow,
15 to 30 seconds at times with the program completely locking up.  I'm using
SQLite as the database, so all of my data is either strings, integers, or
numbers, so I don't think there is anything highly unusual with my data.  It
was so much faster when I was using the mx component.  Unfortunately, I just
found the spark datagrid to display much nicer, to render fonts much more
beautifully than the older component, and I enjoyed working with it.  But
slow as molasses.

Funny thing, there is an old database program deployed in AIR called Lita
that I like to use to quickly look at my sqlite database, and it displays my
data using the older mx datagrid.  Clicking on the headers in Lita sorts the
exact same data almost instantaneously.  So I have to believe that it is
just the difference between the sorting capabilities of the components. 
Essentially, all I am doing is "SELECT * FROM main" to load from the
database, setting the results as the source of my arraycollection, and
displaying it in a datagrid.  With the filters removed, the
currencyformatters removed, and the itemrenders removed, I can't imagine
what I could do programatically to make this simple application any faster.

So the only question I have left before I give up on the spark datagrid and
move back to the mx version is, could writing my own sort routines somehow
run faster than what is built into the spark datagrid? Could it possibly
eliminate anything that is clogging up the system?

Thanks



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Why-are-Spark-Datagrid-headers-sorting-my-data-so-slowly-in-Air-tp13026p13046.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Why are Spark Datagrid headers sorting my data so slowly in Air?

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

>  It looks like version 4.14.1 doesn't like 4.15's descriptor file. 

Should be a matter of changing the application line to have the correct AIR id at the end.

<application xmlns="http://ns.adobe.com/air/application/14.0”>

Justin

Re: Why are Spark Datagrid headers sorting my data so slowly in Air?

Posted by bilbosax <wa...@comcast.net>.
Justin, thanks for the input, I will take a hard look.  Upon further
observation, I installed version 4.14.1, and thought that I applied the
changes, but I don't think that I did, so I tried again and now have an
error in my descriptor file.  It looks like version 4.14.1 doesn't like
4.15's descriptor file.  Is there a way to autogenerate a generic descriptor
file that it will accept so that I can try and run the program with 4.14.1
applied?  Thanks




--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Why-are-Spark-Datagrid-headers-sorting-my-data-so-slowly-in-Air-tp13026p13044.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Why are Spark Datagrid headers sorting my data so slowly in Air?

Posted by Alex Harui <ah...@adobe.com>.

On 7/24/16, 9:48 PM, "Justin Mclean" <ju...@classsoftware.com> wrote:

>> The only other thing that I did is I converted all of the objects in my
>> ArrayCollection to objectProxies
>
>I think (but not tested obviously) you'll find much better performance if
>you don’t use Object/ObjectProxy but create a (non dynamic) named class
>with named bindable properties.

I agree with Justin.  Getting rid of ObjectProxy and using "Value Objects"
would be my bet for the change that would make a key difference.

HTH,
-Alex


Re: Why are Spark Datagrid headers sorting my data so slowly in Air?

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

> I store the dates in my database as integers, and then convert it to simply days in my dataprovider
> arraycollection when I populate it, so it should not be a complex object. 

Do you have any formatters? I see you do below, so in that case it will be called (for every item) when sorting. Adding a custom sort function to sort on the raw values rather than the formatted ones should improve that. Assuming the sort order still makes sense.

> The only other thing that I did is I converted all of the objects in my
> ArrayCollection to objectProxies

I think (but not tested obviously) you'll find much better performance if you don’t use Object/ObjectProxy but create a (non dynamic) named class with named bindable properties.

> I have installed Scout if there is anything in particular that you would
> like to see.

Just look at the self times and see where the majority of time goes. That should be a good start to track down the issue and more importantly test things as you make a few changes.

It looks to me like the sorting is only taking 25% or so of the time so there may be something bigger in there? Sorry it’s hard to tell from a just couple of screen shots, others may have better insights than me.

Thanks,
Justin

Re: Why are Spark Datagrid headers sorting my data so slowly in Air?

Posted by bilbosax <wa...@comcast.net>.
So I used the installer to install Flex 4.14.1 in combination with Air 22.0. 
I thought initially that it helped because the first sort took about 4
seconds.  But all subsequent sorts on the headers took anywhere from 12-30
seconds.  The ArrayCollection that I am using just has fairly bland info in
it - text in the form of addresses and cities, integers in the form of
zipcodes, and four columns that contain either integers or numbers that are
formatted using a currencyformatter for prices.  The size of the array is
about 38k records by 25 columns. I store the dates in my database as
integers, and then convert it to simply days in my dataprovider
arraycollection when I populate it, so it should not be a complex object. 
The only other thing that I did is I converted all of the objects in my
ArrayCollection to objectProxies because I was getting binding errors in my
itemRenderer and that got rid of them. So I have an arrayCollection with
ObjectProxies that contain, strings, integers, and numbers, four of which
have a currencyformatter associated with them.

I have installed Scout if there is anything in particular that you would
like to see.  Please let me know if you have any other thoughts or
suggestions.  I can't really show the program to a client like this, it is
crazy slow.

I doubt it, but would disabling sorting on the headers and creating my own
sorts help at all?



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Why-are-Spark-Datagrid-headers-sorting-my-data-so-slowly-in-Air-tp13026p13040.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Why are Spark Datagrid headers sorting my data so slowly in Air?

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

> having trouble finding a link to download 4.14.  Happen to know of any?

Yep:

http://archive.apache.org/dist/flex/4.14.0/

(other older version are there as well if you ever need then)

You can also use the SDK installer [1] to install older versions.

Thanks,
Justin

1.http://flex.apache.org/installer.html

Re: Why are Spark Datagrid headers sorting my data so slowly in Air?

Posted by bilbosax <wa...@comcast.net>.
having trouble finding a link to download 4.14.  Happen to know of any?



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Why-are-Spark-Datagrid-headers-sorting-my-data-so-slowly-in-Air-tp13026p13038.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Why are Spark Datagrid headers sorting my data so slowly in Air?

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

> I am using Apache Flex 4.15.0 and AIR 20.0

Have you tried using Scout? I find that give a much clearer picture of where the time is being spent.

From a quick look it looks like ObjectUtil.getValue/getSortValueField is taking up a lot of the time (25%). You may want to sort of the self time column to see is anything is taking more time.

What do you have in the ArrayCollection that you are sorting/filtering?

Form a quick look the way getSortValueField is calling getValue it looks rather inefficient for a simple case as it would be creating and throwing away a large number of arrays, also if you have a formatter defined for the column that going to be called a large number of times.

This code was changed to support complex fields [1] so it may be (but I’ve not looked into it) that a performance issue has been introduced for a simple case. You may want to double check by testing the performance with 4.14 SDK (which is missing this support) and see if there a difference.

Thanks,
Justin


1. https://issues.apache.org/jira/browse/FLEX-34852

Re: Why are Spark Datagrid headers sorting my data so slowly in Air?

Posted by bilbosax <wa...@comcast.net>.
I am using Apache Flex 4.15.0 and AIR 20.0



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Why-are-Spark-Datagrid-headers-sorting-my-data-so-slowly-in-Air-tp13026p13036.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Why are Spark Datagrid headers sorting my data so slowly in Air?

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

What version the Flex SDK are you using?

Thanks,
Justin

Re: Why are Spark Datagrid headers sorting my data so slowly in Air?

Posted by bilbosax <wa...@comcast.net>.
Alex, thanks for your continued supervision on my datagrid issue as I feel
really stumped about how to handle it.  I am using Flashbuilder 4.5 Premium
Edition for my Flex projects.  I repeated the profile as you asked and took
out the filters as you suggested and am posting the results.  You will
understand a lot more than I will looking at this list.  At a quick glance,
it looks like the Sort.sort took 3.3 seconds and the ListCollectionView
internal refresh 4.1 seconds.  I look forward to your thoughts about what
looks like the bottleneck and if there is anything that can be done about
it.  Thanks!

<http://apache-flex-users.2333346.n4.nabble.com/file/n13034/profile2.jpg> 



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Why-are-Spark-Datagrid-headers-sorting-my-data-so-slowly-in-Air-tp13026p13034.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Why are Spark Datagrid headers sorting my data so slowly in Air?

Posted by Alex Harui <ah...@adobe.com>.

On 7/23/16, 1:35 PM, "bilbosax" <wa...@comcast.net> wrote:

>Two things from the profiler stand out to
>me that I don't understand.  There is a
>mouseEvent that is called one time but has a cumulative time of 5272
>ms(95.72%) of the entire process.  I can only assume this is the click
>event
>on the header.  

Correct.  Everything pretty much happens inside the click event.

>But what else I see that is surprising to me is that each
>data filter was called 74642 times, and 74642 calls were made to get data
>out of the dropdownlists.  Why would that happen? During a sort, does the
>arraycollection call a refresh regularly?  If so, is there a way to avoid
>this?  Any thoughts or direction would be greatly appreciated. I have
>attached an image of the profile to this post.

As you posted later, it really is "only" two calls per item.  What version
of Flex are you using?

Still, the cumulative time on the filter calls isn't a major portion of
5272 ms.  Did you disable all profiler filters?  There is a button on the
right side of the screen on the same row as the tabs that controls whether
Flex and Flash classes appear in the profiler.  I always turn of those
filters so I can see how Flex and Flash are participating in the profile.
There is a checkbox in the dialog that controls whether global classes
appear.  Make sure they do too.  Then take a fresh look at the results.

You could also set some breakpoints in ListCollectionView.as
internalRefresh to make sure it only gets called once.  You could try
looking at some of the calls to the filters to see the call stack.

HTH,
-Alex


Re: Why are Spark Datagrid headers sorting my data so slowly in Air?

Posted by bilbosax <wa...@comcast.net>.
Another interesting observation is that I have 37,321 records currently,
which means that the 74642 calls that are made to the filters and to get
dropdownlist values is exactly 2 calls per record.



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Why-are-Spark-Datagrid-headers-sorting-my-data-so-slowly-in-Air-tp13026p13032.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Why are Spark Datagrid headers sorting my data so slowly in Air?

Posted by bilbosax <wa...@comcast.net>.
So I ran the performance profile as you suggested and was a little surprised
at what I saw and how to interpret it.  As an explanation of the program, I
basically have set up a big filter system for a large set of data.  I have a
spark datagrid that is used to display 40k records, and then I have
dropdownlists where you can select a filter value such as price.  There are
11 filters and they are arranged in a filterfunctions array.  Whenever there
is a change event on a dropdownlist, a function is called that simply
refreshes the arraycollection, thus calling the filterfunctions that have
been assigned.  When I ran the profiler, I did not select any values for any
of the filters, I simply cleared the profiler, and then clicked on a header
in the datagrid to sort a column.  Two things from the profiler stand out to
me that I don't understand.  There is a
mouseEvent that is called one time but has a cumulative time of 5272
ms(95.72%) of the entire process.  I can only assume this is the click event
on the header.  But what else I see that is surprising to me is that each
data filter was called 74642 times, and 74642 calls were made to get data
out of the dropdownlists.  Why would that happen? During a sort, does the
arraycollection call a refresh regularly?  If so, is there a way to avoid
this?  Any thoughts or direction would be greatly appreciated. I have
attached an image of the profile to this post.

<http://apache-flex-users.2333346.n4.nabble.com/file/n13031/profile.jpg> 



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Why-are-Spark-Datagrid-headers-sorting-my-data-so-slowly-in-Air-tp13026p13031.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Why are Spark Datagrid headers sorting my data so slowly in Air?

Posted by Alex Harui <ah...@adobe.com>.

On 7/23/16, 12:42 AM, "bilbosax" <wa...@comcast.net> wrote:

>Thanks for the quick reply.  I have to admit that although I have
>programmed
>a lot for fun in Flex, this is the first time I want to deploy a desktop
>app
>to be used on a regular basis.  Thus, I was intending on profiling the
>application when I was finished building it, but have very very limited
>experience using the Profiler.
>
>Is there anything in particular that I should be looking for in the
>profiler?
>

The Profiler has two "modes".  The default mode is memory profiling.  Less
obvious is performance profiling which is what you want.  I don't have
time right now to find a link to better instructions, but IIRC the general
idea is:

1) start the profiler
2) At the dialog, choose the performance option AND the memory option
3) Just before you do the sort, find the "Clear Samples" button and hit it.
4) Do the sort
5) Take a performance profile (not a memory snapshot).

If you have trouble interpreting the results, post a link to a screenshot
of what you see.  I won't be back at a computer for about 15 hours.  You
should be able to find prior emails from me helping others on the internet.

HTH,
-Alex


Re: Why are Spark Datagrid headers sorting my data so slowly in Air?

Posted by bilbosax <wa...@comcast.net>.
Thanks for the quick reply.  I have to admit that although I have programmed
a lot for fun in Flex, this is the first time I want to deploy a desktop app
to be used on a regular basis.  Thus, I was intending on profiling the
application when I was finished building it, but have very very limited
experience using the Profiler. Taking a quick look at it, it looks like once
all my components are built and deployed including all my dropdownlist
filters and the datagrid which has been loaded with my 40k records, the
application is using about 90MB of memory. Even after I start playing with
the dropdownlists that I use to filter the datagrid, the memory useage seems
to stay put.  I don't know what it means, but I am a little surprised to see
that an itemrenderer is using 14.32% of the memory with 24 instances.  The
renderer is very simple.  The column data is either true or false, so I have
a button that displays in the renderer and is visible if the value is true
and is not visible if it is false.  The button has a skin that is also using
about 14% of the memory with 24 instances.  These two items are in the top 6
of the items displayed.  I have no idea if this means anything to the
sorting speed of the table when clicking on a header.

Is there anything in particular that I should be looking for in the
profiler?



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Why-are-Spark-Datagrid-headers-sorting-my-data-so-slowly-in-Air-tp13026p13029.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Why are Spark Datagrid headers sorting my data so slowly in Air?

Posted by Alex Harui <ah...@adobe.com>.
Try running the profiler and see what it says.

On 7/22/16, 7:51 PM, "bilbosax" <wa...@comcast.net> wrote:

>I wrote an AIR program two different ways, one using a Spark Datagrid and
>another using the older MX Datagrid. I currently have 40k records
>displaying
>in the datagrid and the end user is going to want to sort the data by
>clicking on the table headers. When I used the older MX version, the sorts
>happened fairly quickly, I was really surprised. But the Spark version is
>so
>incredibly slow, sometimes taking up to a minute to sort the data and
>locking up the program until it is complete. I am not doing anything
>really
>complicated with item renderers. I have one that just displays a tiny
>picture icon, and another that formats an integer into money using a
>currency Formatter. I ended up needing to use the Spark Datagrid for
>presentation purposes. Any idea why the sorting is happening so slowly,
>and
>are you aware of any workarounds to make the sorting on the headers
>faster?
>Thanks!
>
>
>
>--
>View this message in context:
>http://apache-flex-users.2333346.n4.nabble.com/Why-are-Spark-Datagrid-head
>ers-sorting-my-data-so-slowly-in-Air-tp13026.html
>Sent from the Apache Flex Users mailing list archive at Nabble.com.


RE: Re: Why are Spark Datagrid headers sorting my data so slowly in Air?

Posted by bilbosax <wa...@comcast.net>.
Wow, Mark, thank you for the input!  You quickly just saved me a few hours of
research trying to come up with a good plan to handle all of this!  Much
appreciated!



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Why-are-Spark-Datagrid-headers-sorting-my-data-so-slowly-in-Air-tp13026p13058.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.