Element#updateThemeClasses results in a separate setTimeout() call for each widget, which has some overhead, making it slow. For example, the demo currently creates 588 timeouts for this, and we have interfaces larger than that in production (e.g. UploadWizard with 50 uploads, VE transclusion dialog for big transclusions).
There is some small overhead associated with each setTimeout() call (in Chrome, ~0.035 ms); there is some more overhead when the timeout is called (in Chrome, ~0.025 ms); it becomes noticeable when we set up 10,000 timeouts.