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

Issue 1647883004: Support caching histograms so that a lookup isn't done in each iteration. (Closed)

Created:
4 years, 10 months ago by dtapuska
Modified:
4 years, 10 months ago
CC:
blink-reviews, blink-reviews-api_chromium.org, blink-reviews-layout_chromium.org, chromium-reviews, darin-cc_chromium.org, dglazkov+blink, eae+blinkwatch, jam, jchaffraix+rendering, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, szager+layoutwatch_chromium.org, zoltan1
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Support caching histograms so that a lookup isn't done in each iteration. Create a histogram object in blink and use it directly so that we can cache the base::HistogramBase reference. Adding these cache values yields approximately 10% gain on Android blink_perf.svg HitTest performance benchmark. BUG=566913 Committed: https://crrev.com/6b12d45cab8c0433eb702f1079c469b692d70208 Cr-Commit-Position: refs/heads/master@{#372725}

Patch Set 1 #

Total comments: 1

Patch Set 2 : Add histogram object #

Total comments: 4

Patch Set 3 : Remove custom macro definition that wasn't required #

Total comments: 2

Patch Set 4 : Add explicit to protected ctor as well #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+104 lines, -2 lines) Patch
M third_party/WebKit/Source/core/layout/HitTestCache.cpp View 1 2 2 chunks +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutView.cpp View 1 2 2 chunks +9 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/DEPS View 1 1 chunk +2 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/platform/Histogram.h View 1 2 3 1 chunk +46 lines, -0 lines 1 comment Download
A third_party/WebKit/Source/platform/Histogram.cpp View 1 1 chunk +42 lines, -0 lines 1 comment Download
M third_party/WebKit/Source/platform/blink_platform.gypi View 1 1 chunk +2 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 23 (9 generated)
dtapuska
See the perf tryjob here: https://codereview.chromium.org/1631143003/ Looking for comments on my approach. I don't necessarily ...
4 years, 10 months ago (2016-01-29 22:29:17 UTC) #3
esprehn
We don't need all this platform abstraction anymore, Platform can just use base directly and ...
4 years, 10 months ago (2016-01-29 23:01:19 UTC) #4
esprehn
https://codereview.chromium.org/1647883004/diff/1/third_party/WebKit/Source/core/layout/LayoutView.cpp File third_party/WebKit/Source/core/layout/LayoutView.cpp (right): https://codereview.chromium.org/1647883004/diff/1/third_party/WebKit/Source/core/layout/LayoutView.cpp#newcode71 third_party/WebKit/Source/core/layout/LayoutView.cpp:71: Platform::current()->histogramCustomCounts("Event.Latency.HitTestRecursive", duration, 0, 10000000, 100, &histogramCache); DEFINE_STATIC_LOCAL(Histogram, hitTestLatency, ("Event.Latency.HitTestRecursive", ...
4 years, 10 months ago (2016-01-29 23:05:41 UTC) #5
dtapuska
On 2016/01/29 23:05:41, esprehn wrote: > https://codereview.chromium.org/1647883004/diff/1/third_party/WebKit/Source/core/layout/LayoutView.cpp > File third_party/WebKit/Source/core/layout/LayoutView.cpp (right): > > https://codereview.chromium.org/1647883004/diff/1/third_party/WebKit/Source/core/layout/LayoutView.cpp#newcode71 > ...
4 years, 10 months ago (2016-02-01 16:13:03 UTC) #7
esprehn
I think you just want to use DEFINE_THREAD_SAFE_STATIC_LOCAL whenever you need a thread safe one ...
4 years, 10 months ago (2016-02-01 16:21:01 UTC) #8
dtapuska
https://codereview.chromium.org/1647883004/diff/20001/third_party/WebKit/Source/platform/Histogram.h File third_party/WebKit/Source/platform/Histogram.h (right): https://codereview.chromium.org/1647883004/diff/20001/third_party/WebKit/Source/platform/Histogram.h#newcode18 third_party/WebKit/Source/platform/Histogram.h:18: static type name constructor; On 2016/02/01 16:21:00, esprehn wrote: ...
4 years, 10 months ago (2016-02-01 16:28:51 UTC) #9
esprehn
lgtm https://codereview.chromium.org/1647883004/diff/40001/third_party/WebKit/Source/platform/Histogram.h File third_party/WebKit/Source/platform/Histogram.h (right): https://codereview.chromium.org/1647883004/diff/40001/third_party/WebKit/Source/platform/Histogram.h#newcode23 third_party/WebKit/Source/platform/Histogram.h:23: CustomCountHistogram(base::HistogramBase*); explicit, note that even private and protected ...
4 years, 10 months ago (2016-02-01 16:35:08 UTC) #10
dtapuska
https://codereview.chromium.org/1647883004/diff/40001/third_party/WebKit/Source/platform/Histogram.h File third_party/WebKit/Source/platform/Histogram.h (right): https://codereview.chromium.org/1647883004/diff/40001/third_party/WebKit/Source/platform/Histogram.h#newcode23 third_party/WebKit/Source/platform/Histogram.h:23: CustomCountHistogram(base::HistogramBase*); On 2016/02/01 16:35:08, esprehn wrote: > explicit, note ...
4 years, 10 months ago (2016-02-01 16:43:31 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1647883004/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1647883004/60001
4 years, 10 months ago (2016-02-01 18:28:02 UTC) #14
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 10 months ago (2016-02-01 19:48:25 UTC) #16
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/6b12d45cab8c0433eb702f1079c469b692d70208 Cr-Commit-Position: refs/heads/master@{#372725}
4 years, 10 months ago (2016-02-01 19:49:37 UTC) #18
Alexei Svitkine (slow)
https://codereview.chromium.org/1647883004/diff/60001/third_party/WebKit/Source/platform/Histogram.cpp File third_party/WebKit/Source/platform/Histogram.cpp (right): https://codereview.chromium.org/1647883004/diff/60001/third_party/WebKit/Source/platform/Histogram.cpp#newcode14 third_party/WebKit/Source/platform/Histogram.cpp:14: m_histogram = base::Histogram::FactoryGet(name, min, max, bucketCount, base::HistogramBase::kNoFlags); I think ...
4 years, 10 months ago (2016-02-01 19:55:32 UTC) #20
bcwhite
https://codereview.chromium.org/1647883004/diff/60001/third_party/WebKit/Source/platform/Histogram.h File third_party/WebKit/Source/platform/Histogram.h (right): https://codereview.chromium.org/1647883004/diff/60001/third_party/WebKit/Source/platform/Histogram.h#newcode17 third_party/WebKit/Source/platform/Histogram.h:17: class PLATFORM_EXPORT CustomCountHistogram { Why not have a HistogramBase ...
4 years, 10 months ago (2016-02-01 20:06:18 UTC) #22
dtapuska
4 years, 10 months ago (2016-02-01 20:25:06 UTC) #23
Message was sent while issue was closed.
On 2016/02/01 20:06:18, bcwhite wrote:
>
https://codereview.chromium.org/1647883004/diff/60001/third_party/WebKit/Sour...
> File third_party/WebKit/Source/platform/Histogram.h (right):
> 
>
https://codereview.chromium.org/1647883004/diff/60001/third_party/WebKit/Sour...
> third_party/WebKit/Source/platform/Histogram.h:17: class PLATFORM_EXPORT
> CustomCountHistogram {
> Why not have a HistogramBase equivalent rather than specific
> CustomCountHistogram, EnumerationHistogram, etc.  That would make a more
> extensible system for the future.

I thought construction via this was was easiest in that you can't confuse which
type you are creating without
having a whole bunch of targeted macros.

Powered by Google App Engine
This is Rietveld 408576698