| Summary: | Virtual table never converts back to spare array | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Felipe Heidrich <eclipse.felipe> | ||||||
| Component: | SWT | Assignee: | Felipe Heidrich <eclipse.felipe> | ||||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | Silenio_Quarti, snorthov | ||||||
| Version: | 4.0 | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows All | ||||||||
| Whiteboard: | stalebug | ||||||||
| Attachments: |
|
||||||||
|
Description
Felipe Heidrich
Created attachment 167781 [details]
patch
Notes:
The change from non-keyed back to keyed can be triggered by:
a) increase item count
b) decrease the number initialized items in the array
But (b) can never trigger the change because removing an item from the array also decreases the item count. Note that the opposite is not true. Items can be added to the array without increasing the item count.
----
Other problem is that I decided to use a index to count of the exact number of non-null elements in the array to determine when to change to spare array. I could have used items.length but I decided not to because it does not reflect the actual usage of the array.
Created attachment 167815 [details]
patch
New patch, we are still not happy with the patch.
1) the _checkKeys need to be called from other places (like _removeItem())
Example case:
itemcount == 10 with 7 elements created (3 nulls in the array)
remove 5 items (calling table#remove(index))
item count 5, 2 elements (3 nulls) - this case should cause the table to switch back to be keyed.
2) application that add and remove items often (crossing the keycount>count*2 boundary many times) can suffer of bad performance.
On a side note, it seems that the whole keyed strategy should not run when item count is small (not sure exatly how big the table should be to start with the whole keys thing).
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |