|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
Performance issue with EventListModelYesterday I noticed that a JList using a EventListModel performs very very badly in certain situations due to unnecessary cell rendering, while blocking EDT no less.
"certain situations" basically meaning "if a one or more items are selected AND the list is repopulated". Somehow JList seems to update its layout (includes rendering of all cells) in response to selection change events triggered by DefaultSelectionModel which in turn is triggered by EventListModel. See the demo for further information: http://pastebin.com/f5fe233d6 Just start the application and push "Drop". While adding 100 items the cell renderer is called over 5000 times (increasing exponentially, e.g. 200 items -> 20000 rendered cells, ...). This issue seems to be related to another discussion, but using DefaultEventListModel did not fix the issue. http://www.nabble.com/Performance-issue-with-AutoCompleteSupport--tt16463448.html#a16463525 |
|
|
Re: Performance issue with EventListModelRed Noah,
There are some unfortunate inefficiencies in EventListModel.listChanged() at the moment. Hopefully you are able to work around them: When data changes within a JList's ListModel, the UI Delegate responds by re-rendering all values within the data model to determine if the preferred size of the JList has changed. This is the source of so many calls to the renderer. If you can possibly set a prototype cell value, you can dramatically speed up this process, since only the prototype is used to size the JList, and not all values in its data model. The call would be something like this in your example: list.setPrototypeCellValue("Additional String 100"); James On Thu, Apr 30, 2009 at 12:28 PM, rednoah <rednoah42@...> wrote:
|
| Free embeddable forum powered by Nabble | Forum Help |