To limit the impact of MHTML generation on the render process main thread we should break down the processing of a frame into smaller, time-limited tasks.
After processing the main HTML contents, the serialization of elements like CSS and images could be processed in postponed tasks that should run until a certain maximum time is reached.
There will be a compromise between performance and consistency as other tasks run in between can cause changes to the DOM and invalidate elements from the to-serialize list.
Comment 1 by carlosk@chromium.org
, Oct 22 2016