X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2Ftest%2FSmallLocksBenchmark.cpp;h=b3568d06d409b2d225988a63008ca83be7a6fbc8;hb=cfb40f4e3e706cdc6467e9a123fc8001f14ef4c0;hp=db027e535eec9cd31724cecc321f431a497a8150;hpb=ed8c80a0e0988e4ce687f51ca832a00e4a6b7930;p=folly.git diff --git a/folly/test/SmallLocksBenchmark.cpp b/folly/test/SmallLocksBenchmark.cpp index db027e53..b3568d06 100644 --- a/folly/test/SmallLocksBenchmark.cpp +++ b/folly/test/SmallLocksBenchmark.cpp @@ -14,14 +14,16 @@ * limitations under the License. */ -#include -#include #include +#include #include #include #include #include +#include +#include + /* "Work cycle" is just an additional nop loop iteration. * A smaller number of work cyles will result in more contention, * which is what we're trying to measure. The relative ratio of @@ -209,7 +211,7 @@ static void runFairness() { std::for_each(results.begin(), results.end(), [&](const double d) { accum += (d - m) * (d - m); }); - double stdev = sqrt(accum / (results.size() - 1)); + double stdev = std::sqrt(accum / (results.size() - 1)); std::chrono::microseconds mx = *std::max_element(maxes.begin(), maxes.end()); std::chrono::microseconds agAqTime = std::accumulate( aqTime.begin(), aqTime.end(), std::chrono::microseconds(0)); @@ -218,7 +220,7 @@ static void runFairness() { std::chrono::microseconds mean = agAqTime / sum; double variance = (sum * agAqTimeSq - (agAqTime.count() * agAqTime.count())) / sum / (sum - 1); - double stddev2 = sqrt(variance); + double stddev2 = std::sqrt(variance); printf("Sum: %li Mean: %.0f stddev: %.0f\n", sum, m, stdev); printf(