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

Issue 405953002: Fix MQEvaluator::mediaType() related perf regressions. (Closed)

Created:
6 years, 5 months ago by Yoav Weiss
Modified:
6 years, 4 months ago
Reviewers:
esprehn
CC:
darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-css, dglazkov+blink, ed+blinkwatch_opera.com, kenneth.christiansen, rwlbuis, rune+blink
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

Fix MQEvaluator::mediaType() related perf regressions. When we stopped storing the mediaType as a string on m_medium on StyleResolver, we started calling FrameView::mediaType() every time that the mediaType as required. In the related bug's test case, mediaType() was being called a lot, in order to compare it to "print" to see which default style sheet should be used. Since mediaType() calls also call InspectorInstrumentation::applyEmulatedMedia(), they have a certain overhead, that impacted the benchmark's results. I've changed it so that the mediaType() call and the comparison to "print" would be done once, and the result cached. BUG=394275 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=179991

Patch Set 1 #

Patch Set 2 : Build issue #

Patch Set 3 : Changed approach #

Total comments: 1

Patch Set 4 : perf test #

Patch Set 5 : Really fix the issue #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -16 lines) Patch
M Source/core/css/MediaQueryEvaluator.h View 1 2 1 chunk +2 lines, -3 lines 0 comments Download
M Source/core/css/MediaQueryEvaluator.cpp View 1 2 1 chunk +0 lines, -9 lines 0 comments Download
M Source/core/css/resolver/StyleResolver.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/css/resolver/StyleResolver.cpp View 1 2 3 4 3 chunks +7 lines, -4 lines 1 comment Download

Messages

Total messages: 14 (0 generated)
Yoav Weiss
6 years, 5 months ago (2014-07-21 12:39:00 UTC) #1
esprehn
This makes us depend on RVO, and all you're saving is some ref counting, I ...
6 years, 5 months ago (2014-07-21 15:22:32 UTC) #2
Yoav Weiss
On 2014/07/21 15:22:32, esprehn wrote: > This makes us depend on RVO, and all you're ...
6 years, 5 months ago (2014-07-21 15:32:37 UTC) #3
esprehn
This still doesn't make sense. https://codereview.chromium.org/405953002/diff/40001/Source/core/css/resolver/StyleResolver.cpp File Source/core/css/resolver/StyleResolver.cpp (right): https://codereview.chromium.org/405953002/diff/40001/Source/core/css/resolver/StyleResolver.cpp#newcode483 Source/core/css/resolver/StyleResolver.cpp:483: RuleSet* userAgentStyleSheet = printMediaType(document().view()) ...
6 years, 5 months ago (2014-07-25 23:42:04 UTC) #4
Yoav Weiss
On 2014/07/25 23:42:04, esprehn wrote: > This still doesn't make sense. > > https://codereview.chromium.org/405953002/diff/40001/Source/core/css/resolver/StyleResolver.cpp > ...
6 years, 5 months ago (2014-07-26 04:56:26 UTC) #5
esprehn
On 2014/07/26 at 04:56:26, yoav wrote: > On 2014/07/25 23:42:04, esprehn wrote: > ... > ...
6 years, 4 months ago (2014-07-30 05:05:54 UTC) #6
Yoav Weiss
On 2014/07/30 05:05:54, esprehn wrote: > On 2014/07/26 at 04:56:26, yoav wrote: > > On ...
6 years, 4 months ago (2014-08-11 20:09:35 UTC) #7
esprehn
This seems okay, but what updates that bit when you change from non-print -> print? ...
6 years, 4 months ago (2014-08-11 20:33:21 UTC) #8
Yoav Weiss
On 2014/08/11 20:33:21, esprehn wrote: > This seems okay, but what updates that bit when ...
6 years, 4 months ago (2014-08-11 20:38:12 UTC) #9
esprehn
lgtm, okay
6 years, 4 months ago (2014-08-11 20:40:39 UTC) #10
Yoav Weiss
The CQ bit was checked by yoav@yoav.ws
6 years, 4 months ago (2014-08-11 20:52:16 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yoav@yoav.ws/405953002/80001
6 years, 4 months ago (2014-08-11 20:52:29 UTC) #12
Yoav Weiss
On 2014/08/11 20:38:12, Yoav Weiss wrote: > On 2014/08/11 20:33:21, esprehn wrote: > > This ...
6 years, 4 months ago (2014-08-11 21:04:46 UTC) #13
commit-bot: I haz the power
6 years, 4 months ago (2014-08-11 21:10:50 UTC) #14
Message was sent while issue was closed.
Change committed as 179991

Powered by Google App Engine
This is Rietveld 408576698