« Return to Thread: 20 Seconds for sorting simple table

Re: 20 Seconds for sorting simple table

by ceekay :: Rate this Message:

Reply to Author | View in Thread


you're right, initiating new SimpleDateFormat is the most consuming, must have overlooked that.
Now it takes +- 4 à 5 seconds to sort the table which is much more exceptable.

Thanks a lot for looking at my code in detail. Appreciate.





Holger Brands wrote:
I can give you two advices:

- if you use JXTable with TableComparatorChooser you should
call JXTable.setSortable(false) to let GL do the sorting

- make you Comparators and TableFormat implementations as efficient as possible

In your code example, your TableFormat.getColumnValue() implementation
instantiates a new SimpleDateFormat object everytime, which is expensive.
If you can avoid this, the sorting should perform much better.

Hope this helps,
Holger

>
>
> Guess you're right, I haven't got much expirience with profiling but in
> attachment you can find a report of the 'call' tree.
>
> http://www.nabble.com/file/p17765008/Call_Tree.html Call_Tree.html
>
>
> Holger Brands wrote:
> >
> > Ok.
> > I just tried your example and most time
> > is consumed by SortedList.setComparator(..).
> >
> > We'd have to profile this example to get more details...
> >
> > Holger
> >
> >>
> >>
> >> I've read the FAQ before posting and assertions are disabled.
> >> Thanks
> >>
> >>
> >>
> >> Holger Brands wrote:
> >> >
> >> > You should first try the suggestion in the performance FAQ to
> >> > disable assertions:
> >> >
> >> http://www.publicobject.com/glazedlists/wiki/index.php?title=FAQ#Performance
> >> >
> >> > Hope this helps,
> >> > Holger
> >> >
> >> >>
> >> >> I've an ArrayList filled with +- 30000 objects of type
> >> 'InstrumentBean'.
> >> >>
> >> >> I've followed the tutorial to create a sortable JTable. (I'm using
> >> >> JXTable
> >> >> but that won't make the difference).
> >> >>
> >> >> When I click on a header to sort by a column, my CPU goes 100% and it
> >> >> takes
> >> >> 20 seconds before the table is sorted and I have control again.
> >> >>
> >> >> Is this normal ?
> >> >>
> >> >> I've attached my source code.
> >> >>
> >> >> http://www.nabble.com/file/p17753926/TestGlazedLists.rar
> >> >> TestGlazedLists.rar
> >> >>
> >> >> You will find a file instruments.xml from which I create my collection
> >> of
> >> >> 'InstrumentBeans'.
> >> >> This collection will be used to create the sortable table.
> >> >>
> >> >> Thanks for your help
> >> >>
> >> >>
> >> >> --
> >> >> View this message in context:
> >> >>
> >> http://www.nabble.com/20-Seconds-for-sorting-simple-table-tp17753926p17753926.html
> >> >> Sent from the GlazedLists - User mailing list archive at Nabble.com.
> >> >>
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: users-unsubscribe@glazedlists.dev.java.net
> >> >> For additional commands, e-mail: users-help@glazedlists.dev.java.net
> >> >>
> >> >>
> >> >
> >> >
> >> > ______________________________________________________________
> >> > Jeden Monat 1 hochkarätiger maxdome-Blockbuster GRATIS!
> >> > Exklusiv für alle WEB.DE Nutzer. http://www.blockbuster.web.de
> >> >
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: users-unsubscribe@glazedlists.dev.java.net
> >> > For additional commands, e-mail: users-help@glazedlists.dev.java.net
> >> >
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/20-Seconds-for-sorting-simple-table-tp17753926p17754408.html
> >> Sent from the GlazedLists - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@glazedlists.dev.java.net
> >> For additional commands, e-mail: users-help@glazedlists.dev.java.net
> >>
> >>
> >
> >
> > _____________________________________________________________________
> > Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
> > http://smartsurfer.web.de/?mc=100071&distributionid=000000000066
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@glazedlists.dev.java.net
> > For additional commands, e-mail: users-help@glazedlists.dev.java.net
> >
> >
> >
>
> --
> View this message in context: http://www.nabble.com/20-Seconds-for-sorting-simple-table-tp17753926p17765008.html
> Sent from the GlazedLists - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glazedlists.dev.java.net
> For additional commands, e-mail: users-help@glazedlists.dev.java.net
>
>


______________________________________________________________
Jeden Monat 1 hochkarätiger maxdome-Blockbuster GRATIS!
Exklusiv für alle WEB.DE Nutzer. http://www.blockbuster.web.de


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glazedlists.dev.java.net
For additional commands, e-mail: users-help@glazedlists.dev.java.net

 « Return to Thread: 20 Seconds for sorting simple table

LightInTheBox - Buy quality products at wholesale price!