2017
[folly.git] / folly / test / AsciiCaseInsensitiveBenchmark.cpp
index 89c92b75606baf4f7eb48c8bdcba130a8ed7ac44..b1f9142e89e101a1648182d65e18299dcbd161c8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#include "folly/Benchmark.h"
-#include "folly/Range.h"
+#include <folly/Benchmark.h>
+#include <folly/Range.h>
 
 #include <algorithm>
 
@@ -80,7 +80,7 @@ string lorem_ipsum =
 "vulputate quam urna quis eros. Donec vel."
 "\n";
 
-string needle = "commodo";
+const string needle = "commodo";
 
 // legacy implementation
 struct AsciiCaseInsensitiveLegacy {
@@ -100,6 +100,7 @@ inline void test_operator_on_search(int iters) {
       cmp
     ) - lorem_ipsum.begin();
   }
+  doNotOptimizeAway(dummy);
 }
 
 BENCHMARK(LegacyCaseInsensitiveCheck, iters) {
@@ -111,7 +112,7 @@ BENCHMARK(CurrentCaseInsensitiveCheck, iters) {
 }
 
 int main(int argc, char** argv) {
-  google::ParseCommandLineFlags(&argc, &argv, true);
+  gflags::ParseCommandLineFlags(&argc, &argv, true);
   folly::runBenchmarks();
   if (FLAGS_benchmark) {
     folly::runBenchmarks();