I am using SwingWorker
to query a server process for a large number of "result" objects on a background thread. As individual results arrive I want to publish them and display them on the GUI.
My question is: Given that I will be receiving potentially thousands of results is it more efficient to call publish(V... chunks)
for every N results or should I just call publish
for each event received?
I see that the documentation states that multiple calls to publish
will be coalesced into a single call to process
but wasn't sure if it was still better to retain some form of control in my own code by throttling when I call publish. What do people recommend?