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

Unified Diff: src/utils.h

Issue 13933026: Add a performance test showing that List is not as efficient as std::vector. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Better sort Created 7 years, 8 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 | « src/list-inl.h ('k') | test/cctest/cctest.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils.h
diff --git a/src/utils.h b/src/utils.h
index b84d59238653ce5dad71b3f12d23a2133a9456c8..3bb31d1817c5304159a6f2feac578c66e4b35943 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -30,6 +30,7 @@
#include <stdlib.h>
#include <string.h>
+#include <algorithm>
#include <climits>
#include "allocation.h"
@@ -417,6 +418,10 @@ class Vector {
reinterpret_cast<RawComparer>(cmp));
}
+ void SortBetter() {
+ std::sort(start(), start() + length());
+ }
+
void Sort() {
Sort(PointerValueCompare<T>);
}
« no previous file with comments | « src/list-inl.h ('k') | test/cctest/cctest.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698