JDK-6231057 : JTable is slow for variable-row-sizes
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 5.0
  • Priority: P5
  • Status: Open
  • Resolution: Unresolved
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2005-02-18
  • Updated: 2013-05-15
I have a JTable with variable-height rows. Since SizeSequence requires O(N) to process inserts and removes, inserts and removes to my JTable are very slow.

The SizeSequence should be changed to use a tree internally so that all operations are O(log N).

Adding or removing a single row to a table of size N rows takes N operations. This causes JTable to be very slow. By using a tree to store data inside SizeSequence, the number of operations could be reduced to O(log N).

When filtering is applied to a JTable, several rows may be inserted or deleted at once. For example, if a filter of N elements removes N/2 elements, then the cost to perform this filter is O(N^2).

This could also be made even faster by lazy-updating within SizeSequence.
###@###.### 2005-2-18 18:40:34 GMT