FabricMC / Enigma

This is a fork of cuchaz's Enigma, a deobfuscation/remapping tool for Java software.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

search lag: the awt event queue refuses to stop until it finishes all render requests

liach opened this issue · comments

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.

My guess is that on

currentSearch = su.asyncSearch(searchField.getText(), (idx, e) -> SwingUtilities.invokeLater(() -> classListModel.insertElementAt(e, idx)));

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