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

Unified Diff: third_party/WebKit/Source/core/inspector/InstanceCounters.cpp

Issue 2393353003: Fix performance issue in InstanceCounters for DOM nodes (Closed)
Patch Set: Address on reviews Created 4 years, 2 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
« no previous file with comments | « third_party/WebKit/Source/core/inspector/InstanceCounters.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/inspector/InstanceCounters.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InstanceCounters.cpp b/third_party/WebKit/Source/core/inspector/InstanceCounters.cpp
index c5948b98763ac088a1d4ea12c76fa93d1f63709a..50cf7181322887d85829936d53d96bcc4af3d7f8 100644
--- a/third_party/WebKit/Source/core/inspector/InstanceCounters.cpp
+++ b/third_party/WebKit/Source/core/inspector/InstanceCounters.cpp
@@ -34,7 +34,15 @@ namespace blink {
int InstanceCounters::s_counters[CounterTypeLength];
+// Counts only nodes for a performance reason. Many node are created and atomic
+// barriers or locks should be avoided (crbug/641019).
+int InstanceCounters::s_nodeCounter;
+
int InstanceCounters::counterValue(CounterType type) {
+ if (type == NodeCounter) {
+ DCHECK(isMainThread());
+ return s_nodeCounter;
+ }
return acquireLoad(&s_counters[type]);
}
« no previous file with comments | « third_party/WebKit/Source/core/inspector/InstanceCounters.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698