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

Unified Diff: Source/core/dom/Node.cpp

Issue 1220253004: Implement a fast buffer allocator for Vector, HashTable and StringBuilder Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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 | « Source/bindings/core/v8/WindowProxy.cpp ('k') | Source/platform/heap/BufferAllocator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Node.cpp
diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp
index b43e212fa481249fdb2f37f2694fe3f32096852a..40883912f2e0c8979430daa1ced6a2bbd7f071f2 100644
--- a/Source/core/dom/Node.cpp
+++ b/Source/core/dom/Node.cpp
@@ -519,6 +519,92 @@ void Node::normalize()
}
}
+/*
+const AtomicString& Node::namespaceURI() const
+{
+ double begin, end;
+ int sum;
+
+ fprintf(stderr, "# Vector 1\n");
+ for (int loopCount = 100; loopCount < 100000; loopCount = loopCount * 3 / 2) {
+ begin = WTF::currentTimeMS();
+ sum = 0;
+ for (int j = 0; j < 1000; j++) {
+ Vector<Node*> vector1;
+ for (int i = 0; i < loopCount; i++) {
+ vector1.append(const_cast<Node*>(this));
+ }
+ sum += vector1.size();
+ }
+ end = WTF::currentTimeMS();
+ fprintf(stderr, "%d %.2lf %d\n", loopCount, end - begin, sum);
+ }
+ fprintf(stderr, "\n\n\n");
+
+ fprintf(stderr, "# std::vector 1\n");
+ for (int loopCount = 100; loopCount < 100000; loopCount = loopCount * 3 / 2) {
+ begin = WTF::currentTimeMS();
+ sum = 0;
+ for (int j = 0; j < 1000; j++) {
+ std::vector<Node*> vector1;
+ for (int i = 0; i < loopCount; i++) {
+ vector1.push_back(const_cast<Node*>(this));
+ }
+ sum += vector1.size();
+ }
+ end = WTF::currentTimeMS();
+ fprintf(stderr, "%d %.2lf %d\n", loopCount, end - begin, sum);
+ }
+ fprintf(stderr, "\n\n\n");
+
+ fprintf(stderr, "# Vector 3\n");
+ for (int loopCount = 100; loopCount < 100000; loopCount = loopCount * 3 / 2) {
+ begin = WTF::currentTimeMS();
+ sum = 0;
+ for (int j = 0; j < 1000; j++) {
+ Vector<Node*> vector1;
+ Vector<Node*> vector2;
+ Vector<Node*> vector3;
+ for (int i = 0; i < loopCount; i++) {
+ vector1.append(const_cast<Node*>(this));
+ vector2.append(const_cast<Node*>(this));
+ vector3.append(const_cast<Node*>(this));
+ }
+ sum += vector1.size();
+ sum += vector2.size();
+ sum += vector3.size();
+ }
+ end = WTF::currentTimeMS();
+ fprintf(stderr, "%d %.2lf %d\n", loopCount, end - begin, sum);
+ }
+ fprintf(stderr, "\n\n\n");
+
+ fprintf(stderr, "# std::vector 3\n");
+ for (int loopCount = 100; loopCount < 100000; loopCount = loopCount * 3 / 2) {
+ begin = WTF::currentTimeMS();
+ sum = 0;
+ for (int j = 0; j < 1000; j++) {
+ std::vector<Node*> vector1;
+ std::vector<Node*> vector2;
+ std::vector<Node*> vector3;
+ for (int i = 0; i < loopCount; i++) {
+ vector1.push_back(const_cast<Node*>(this));
+ vector2.push_back(const_cast<Node*>(this));
+ vector3.push_back(const_cast<Node*>(this));
+ }
+ sum += vector1.size();
+ sum += vector2.size();
+ sum += vector3.size();
+ }
+ end = WTF::currentTimeMS();
+ fprintf(stderr, "%d %.2lf %d\n", loopCount, end - begin, sum);
+ }
+ fprintf(stderr, "\n\n\n");
+
+ return nullAtom;
+}
+*/
+
bool Node::isContentEditable(UserSelectAllTreatment treatment)
{
document().updateLayoutTreeIfNeeded();
« no previous file with comments | « Source/bindings/core/v8/WindowProxy.cpp ('k') | Source/platform/heap/BufferAllocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698