RegisterSearchFAQ UsergroupsLog in
TableReorder part two: horrible performance

 
Reply to topic    Citra Technologies Forum Index » Report a Bug View previous topic
View next topic

TableReorder part two: horrible performance
Author Message
cone



Joined: 29 May 2007
Posts: 353

Post TableReorder part two: horrible performance Reply with quote
Hi,

in difference to version 4.2 the performance is getting worst in version 4.13.

Please make a testcase with 10.000 rows and 100 columns.
If you sort a column all things went fine (3.924 ns) but if you select all cells the sort needs 326.797.924.940 ns!

Kind regards,
michael
Mon Dec 11, 2017 7:28 am View user's profile Send private message
cone



Joined: 29 May 2007
Posts: 353

Post Reply with quote
Hi support,

can you reproduce the problem or do you need some more information?

Kind regards,
michael
Wed Dec 13, 2017 3:52 am View user's profile Send private message
cone



Joined: 29 May 2007
Posts: 353

Post Reply with quote
Also Version 4.9 is extremly slow Sad
Never tested this before and now after the customer do it i was shocked.

Hopefully you will find a solution.



PerformanceTestAdvancedJTableModel.java
 Description:

Download
 Filename:  PerformanceTestAdvancedJTableModel.java
 Filesize:  3.26 KB
 Downloaded:  212 Time(s)


PerformanceTestAdvancedJTableApp.java
 Description:

Download
 Filename:  PerformanceTestAdvancedJTableApp.java
 Filesize:  5.42 KB
 Downloaded:  61 Time(s)

Thu Dec 14, 2017 1:18 am View user's profile Send private message
support



Joined: 21 Feb 2006
Posts: 1463

Post Reply with quote
Hi,

I found that the problem is with ListRowHeader which is based on JLIst: every time a row is selected in the table, it takes a considerable amount of time for ListRowHeader to update to the table's contents. I've been trying to find a way to fix this, but it seems that it can't be fixed because when the list's row height is not fixed - as in JTable's case -, JList needs to scan all rows for every update.

A solution to this is to limit, as much as possible, the row selection updates, which is now done with TableReorder.setRestoreSelectionsInBatches(true). (version 4.16) This improves performance a lot, in the case where a ListRowHeader is present or otherwise, but the best solution is to build a RowHeader based on JTable instead of JList, to avoid the update issue altogether. I already started working on this but ran into some problems, I will try to finish it as soon as possible.

Thanks
Wed Dec 20, 2017 7:46 am View user's profile Send private message
cone



Joined: 29 May 2007
Posts: 353

Post Reply with quote
Hi,

well the performance gets worst because the ListRowHeader now (4.13) register a ListSelectionListener.

If you dont't use the Listener or uncomment
Code:

   private class TableListener implements ListSelectionListener {
      public void valueChanged(ListSelectionEvent e) {
         setSelectedIndices(table.getSelectedRows());
      }
   }

then the performance is good.

Maybe it is possible if you include new functionality you can make it switchable?
The best for me is when the old functionality is still working with a new version of your table.

In my opinion is the problem the TableListener in combination with TableReorder which reselects all cell by cell and the ListSelectionListener do a setSelectedIndex every time new with table.getSelectedRows()!

Kind regards,
michael
Tue Jan 02, 2018 3:36 am View user's profile Send private message
support



Joined: 21 Feb 2006
Posts: 1463

Post Reply with quote
cone wrote:

In my opinion is the problem the TableListener in combination with TableReorder which reselects all cell by cell and the ListSelectionListener do a setSelectedIndex every time new with table.getSelectedRows()!


TableReorder can now be set to reselect cells in batches, which improves performance a lot. But I'll see what I can do.
Thu Jan 04, 2018 6:30 am View user's profile Send private message
support



Joined: 21 Feb 2006
Posts: 1463

Post Reply with quote
Hi,

I changed ListRowHeader to use a fixed cell height by default, which changes to variable only when the table also uses a variable row height. This improves performance a lot, and what TableListener does by selecting all rows again when the selection of the table changes, does not have an impact on performance.

Thanks
Fri Feb 09, 2018 6:15 am View user's profile Send private message
cone



Joined: 29 May 2007
Posts: 353

Post Reply with quote
Sorry, but i guess that you didn't have test it or i didn't understand you.
> what TableListener does by selecting all rows again when the selection of the table changes, does not have an impact on performance.

Please take your demo tab "Table"
* add 10.000 rows
* click on "Show row header"
* do a sort
* wait 1minute!!!

if you didn't show the rowheader the sort finishes under a second!

Maybe i can set a batch-property but didn't you think, that it have to work without that?
Imagine how long you have to wait if you have 60.000 rows. Our customer is upset Sad

Kind regards
michael
Fri Feb 23, 2018 7:05 am View user's profile Send private message
support



Joined: 21 Feb 2006
Posts: 1463

Post Reply with quote
Hi,

I just tried the demo like you said, and didn't notice a slow performance, sorting returned under a second.
Please make sure that you have the latest version, 4.17 (it has the AdvancedJTable.setRowHeight methods overriden).
Mon Feb 26, 2018 3:45 am View user's profile Send private message
cone



Joined: 29 May 2007
Posts: 353

Post Reply with quote
Sorry, i missed a step:

Please take your demo tab "Table"
* add 10.000 rows
* click on "Show row header"
MISSING STEP: SELECT ALL!
* do a sort
* wait 1minute!!!

I used the new version (4.17)

Kind regards,
michael
Mon Feb 26, 2018 4:08 am View user's profile Send private message
support



Joined: 21 Feb 2006
Posts: 1463

Post Reply with quote
Ah, ok! Smile I see what you mean now, although I can fix it with the trick with the batch selections, I will change the way ListRowHeader updates its selections.
Mon Feb 26, 2018 5:12 am View user's profile Send private message
cone



Joined: 29 May 2007
Posts: 353

Post Reply with quote
Hi,
can you please deploy the fixed version?

Kind regards,
michael
Mon Mar 05, 2018 2:45 am View user's profile Send private message
cone



Joined: 29 May 2007
Posts: 353

Post Reply with quote
Hi,

can you please deploy the fix?

Kind regards,
michael
Wed Mar 14, 2018 1:10 am View user's profile Send private message
support



Joined: 21 Feb 2006
Posts: 1463

Post Reply with quote
Hello,

I just uploaded version 4.18, with the TableReorder fix included, I wanted to include some other fixes as well, but it's taking me a lot of time to properly test these, so here it is.

Thanks
Wed Mar 14, 2018 4:15 am View user's profile Send private message
cone



Joined: 29 May 2007
Posts: 353

Post Reply with quote
thank you, it works Smile
Thu Mar 15, 2018 7:20 am View user's profile Send private message
Display posts from previous:    

Reply to topic    Citra Technologies Forum Index » Report a Bug All times are GMT - 5 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group