Community
Participate
Working Groups
All Motif: Make a virtual table with three columns and 20,000 rows, each cell of the table containing text of length about 20 characters. Then call removeAll() on the table. The app will hang for almost a minute. There is a workaround: Table.setItemCount(0) is not slow. Examining the code, I believe that there is a severe inefficiency in the algorithm used in removeAll(). The main loop in removeAll() is: while (itemsCount > 0) { items [0].dispose (true); } Examining the code in TableItem.dispose(boolean) we see that it delegates to Table.destroyItem(TableItem item), and that this method works by creating a new array of TableItems and copying the original array minus the item to be disposed. The net effect is that to delete a table with 20,000 rows what we are doing is first creating a table with 19,999 rows, then creating a table with 19,998 rows etc. until finally we have an empty table. Clearly this is not an efficient algorithm.
fixed > 0721 in Table and Tree
*** Bug 113269 has been marked as a duplicate of this bug. ***