Fully clean up before each round of benchmarks in RangeFindBenchmark.cpp
authorYedidya Feldblum <yfeldblum@fb.com>
Tue, 22 Sep 2015 21:03:09 +0000 (14:03 -0700)
committerfacebook-github-bot-9 <folly-bot@fb.com>
Tue, 22 Sep 2015 21:20:18 +0000 (14:20 -0700)
Summary: [Folly] Fully clean up before each round of benchmarks in `RangeFindBenchmark.cpp`.

The `vstr` and `vstrp` globals need to be cleaned up before each round of benchmarks.

Reviewed By: @​@​nbronson

Differential Revision: D2467254

folly/test/RangeFindBenchmark.cpp

index 7d7a872d99340a48fd50fcd3afb216f2198f9b68..2c920b7246df5213444ecb19ca5e4c0f254a9db7 100644 (file)
@@ -43,8 +43,11 @@ std::vector<StringPiece> vstrp;
 std::string file;
 
 void initStr(int len) {
-  cout << "string length " << len << ':' << endl;
   str.clear();
+  vstr.clear();
+  vstrp.clear();
+
+  cout << "string length " << len << ':' << endl;
   str.reserve(len + 1);
   str.append(len, 'a');
   str.append(1, 'b');