At the moment, diagnostic markers (error/warning underlines) are redrawn every time a message arrives from the server. Also, all the document's markers are cleared and all of them are re-inserted. This could be made more efficient if there are performance problems:
marker re-drawings could be batched and performed only after some small delay in case multiple diagnostic messages arrive in burst from the server
some diff could be calculated against the displayed markers and only the differences could be cleared/redrawn
possibly, only the visible area of the document could be redrawn
At the moment, diagnostic markers (error/warning underlines) are redrawn every time a message arrives from the server. Also, all the document's markers are cleared and all of them are re-inserted. This could be made more efficient if there are performance problems: