Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Issue 2411853002: MHTML saving optimization: don't generate CSS code that will be discarded. (Closed)

Created:
4 years, 2 months ago by carlosk
Modified:
4 years, 2 months ago
Reviewers:
CC:
chromium-reviews
Target Ref:
refs/pending/branch-heads/2883
Project:
chromium
Visibility:
Public.

Description

MHTML saving optimization: don't generate CSS code that will be discarded. FrameSerializer::serializeCSSStyleSheet code was generating CSS code for all style elements in a frame even if they were already included in the main HTML body generation executed earlier on in FrameSerializer::serializeFrame. This generated code was simply discarded later on. This change detects early on if generating the CSS code will be really needed and skips it if not. Also, when the CSS can be uniquely identified by its URL and that URL was already analyzed before the method simply returns. Tests on a Samsung Galaxy J1 loading a CSS-heavy web page [1] showed roughly 40% less CSS code generated and 20% less accumulative time taken from all render processes' main threads for the whole save operation. [1] http://www.creativebloq.com/web-design/examples-css-912710 BUG=651525 Review-Url: https://codereview.chromium.org/2397983002 Cr-Commit-Position: refs/heads/master@{#424032} (cherry picked from commit f72e2c5e69ca7a44db46622e96f2eaab2849d70a) Committed: https://chromium.googlesource.com/chromium/src/+/5453db5beff03a09ad40a2b704dd4b40b8273015

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+31 lines, -17 lines) Patch
M third_party/WebKit/Source/core/frame/FrameSerializer.cpp View 3 chunks +31 lines, -17 lines 0 comments Download

Messages

Total messages: 2 (1 generated)
carlosk
4 years, 2 months ago (2016-10-11 18:40:23 UTC) #2
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
5453db5beff03a09ad40a2b704dd4b40b8273015.

Powered by Google App Engine
This is Rietveld 408576698