[PATCH] D27068: Improve string::find

Sebastian Pop via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 28 10:13:28 PST 2016


sebpop added a comment.

Please also post the performance numbers from the added benchmarks with and without the change to the lib.



================
Comment at: libcxx/benchmarks/string.bench.cpp:12
+// until the end of s1.
+static void BM_StringFindPhase1(benchmark::State& state) {
+  // Benchmark following the length of s1.
----------------
Let's call this benchmark "BM_StringFindNoMatch"


================
Comment at: libcxx/benchmarks/string.bench.cpp:21
+
+// Benchmark the __phase2 part of string search: we want the strings s1 and s2
+// to match from the first char in s1.
----------------
Please reword to remove the reference to __phase2.


================
Comment at: libcxx/benchmarks/string.bench.cpp:23
+// to match from the first char in s1.
+static void BM_StringFindPhase2(benchmark::State& state) {
+  std::string s1(MAX_STRING_LEN, '-');
----------------
Let's call this benchmark "BM_StringFindAllMatch"


https://reviews.llvm.org/D27068





More information about the cfe-commits mailing list