From e39dfd9da543edf915060d4f981ae145d8b90c2b Mon Sep 17 00:00:00 2001 From: Lucian Grijincu Date: Mon, 14 Apr 2014 20:15:10 -0700 Subject: [PATCH] folly: improve ProducerConsumerQueueBenchmark (misplaced doNotOptimizeAway) Summary: as per discussion from https://phabricator.fb.com/D1274352 After changing the queue length to be a small value (100) I didn't see improvement from cache alignment of atomics (too much noise). Dropping that and just fixing the benchmark. Test Plan: n/a Reviewed By: ngbronson@fb.com FB internal diff: D1276591 --- folly/test/ProducerConsumerQueueBenchmark.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/folly/test/ProducerConsumerQueueBenchmark.cpp b/folly/test/ProducerConsumerQueueBenchmark.cpp index 52a92518..cea07874 100644 --- a/folly/test/ProducerConsumerQueueBenchmark.cpp +++ b/folly/test/ProducerConsumerQueueBenchmark.cpp @@ -72,8 +72,8 @@ struct ThroughputTest { for (int i = 0; i < iters_; ++i) { ThroughputType item = 0; while (!queue_.read(item)) { - doNotOptimizeAway(item); } + doNotOptimizeAway(item); } } -- 2.34.1