At the moment, we use a copy-and-pasted version of two libraries to convert wikitext into HTML and then make a preview out of that. However, action=parse (called with section=0) already gets the HTML of the first section; we only need to trim it down to size and remove infoboxes, etc.
This would reduce the size of popups considerably and quite possibly result in a noticeable speed improvement, since the HTML is cached serverside.