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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutView.cpp

Issue 1647883004: Support caching histograms so that a lookup isn't done in each iteration. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/LayoutView.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutView.cpp b/third_party/WebKit/Source/core/layout/LayoutView.cpp
index 5ea72b0b474149b6d37b466e1e69c05fd7e99fd4..d74ca5daaf6a50ba4115e63f0e406a9cb4eae20d 100644
--- a/third_party/WebKit/Source/core/layout/LayoutView.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutView.cpp
@@ -66,7 +66,13 @@ public:
~HitTestLatencyRecorder()
{
int duration = static_cast<int>((WTF::monotonicallyIncreasingTime() - m_start) * 1000000);
- Platform::current()->histogramCustomCounts(m_allowsChildFrameContent ? "Event.Latency.HitTestRecursive" : "Event.Latency.HitTest", duration, 0, 10000000, 100);
+ if (m_allowsChildFrameContent) {
+ static Platform::HistogramCacheSlot histogramCache = 0;
+ Platform::current()->histogramCustomCounts("Event.Latency.HitTestRecursive", duration, 0, 10000000, 100, &histogramCache);
esprehn 2016/01/29 23:05:40 DEFINE_STATIC_LOCAL(Histogram, hitTestLatency, ("E
+ } else {
+ static Platform::HistogramCacheSlot histogramCache = 0;
+ Platform::current()->histogramCustomCounts("Event.Latency.HitTest", duration, 0, 10000000, 100, &histogramCache);
+ }
}
private:
« no previous file with comments | « third_party/WebKit/Source/core/layout/HitTestCache.cpp ('k') | third_party/WebKit/public/platform/Platform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698