search lag: the awt event queue refuses to stop until it finishes all render requests
liach opened this issue · comments
Chen Liang commented
Seems if a search yields a ton of results, the awt event queue will render all those results, and time is wasted on repeatedly expanding the ui, setting text, etc. (per jdk mission control) maybe we can choose to only show top 1000 results if we find too many.
Chen Liang commented
My guess is that on
make it
currentSearch = su.asyncSearch(searchField.getText(), (idx, e) -> SwingUtilities.invokeLater(() -> if (this.classListModel == classListModel) classListModel.insertElementAt(e, idx)));
to skip pending swing calls when the search is replaced. Swing sorting is slow as heck after all