[libcxx-commits] [PATCH] D62778: [1/2] Add a benchmark for map operations.

Marshall Clow via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 10 16:49:51 PDT 2019


mclow.lists added inline comments.


================
Comment at: libcxx/benchmarks/map.bench.cpp:57
+  for (uint64_t I = 0; I < MapSize; ++I) {
+    R.Keys.push_back(mode == Mode::Hit ? 2 * I + 2 : 2 * I + 1);
+  }
----------------
The fact that the keys you use to test are ordered is troubling to me. See comment on `erase`


================
Comment at: libcxx/benchmarks/map.bench.cpp:683
+#else
+          size_t I = Map.erase(K);
+          if (Mode() == ::Mode::Hit) {
----------------
Isn't this just "Erase the first element" over and over until the map is empty?


================
Comment at: libcxx/benchmarks/map.bench.cpp:712
+        auto& Map = Data.Maps[I];
+        for (auto H : Data.Hints[I]) {
+          benchmark::DoNotOptimize(Map.erase(H));
----------------
Same with this one - isn't this just erasing the first element over and over?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62778/new/

https://reviews.llvm.org/D62778





More information about the libcxx-commits mailing list