Skip to content

Commit 157adeb

Browse files
committed
downsized test
1 parent 786d595 commit 157adeb

1 file changed

Lines changed: 2 additions & 12 deletions

File tree

src/test/queue.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@ static QueueStressTestResult test_many_producers_one_consumer(int thread_count,
6969
queue.enqueue(value);
7070
local_checksum += static_cast<uint64_t>(value);
7171
size_t x = total_sent2.fetch_add(1, std::memory_order_relaxed);
72-
if (x % 10000 == 0) {
73-
printf("%llu\n", x);
74-
fflush(stdout);
75-
}
7672
}
7773
total_sent.fetch_add(items_per_producer, std::memory_order_relaxed);
7874
sent_checksum.fetch_add(local_checksum, std::memory_order_relaxed);
@@ -81,8 +77,6 @@ static QueueStressTestResult test_many_producers_one_consumer(int thread_count,
8177
}
8278

8379
std::thread consumer([&queue, &total_received, &received_checksum]() {
84-
fprintf(stderr, "Consumer started\n");
85-
fflush(stderr);
8680
int64_t value;
8781
uint64_t local_checksum = 0;
8882
size_t count = 0;
@@ -97,12 +91,8 @@ static QueueStressTestResult test_many_producers_one_consumer(int thread_count,
9791
int j = 0;
9892
for (auto& t : producers) {
9993
t.join();
100-
fprintf(stderr, "Producer %d joined\n", j++);
101-
fflush(stderr);
10294
}
10395
consumer.join();
104-
fprintf(stderr, "Consumer joined\n", j++);
105-
fflush(stderr);
10696

10797
const size_t expected_count = static_cast<size_t>(producer_count) * items_per_producer;
10898
const size_t sent = total_sent.load();
@@ -172,8 +162,8 @@ static QueueStressTestResult test_one_producer_many_consumers(int thread_count,
172162

173163
int run_queue_stress_test() {
174164
const int thread_count = static_cast<int>(std::thread::hardware_concurrency());
175-
const size_t items_per_producer = 10000;
176-
const size_t total_items = 500000;
165+
const size_t items_per_producer = 1000;
166+
const size_t total_items = 50000;
177167

178168
std::cout << "Queue Stress Test" << std::endl;
179169
std::cout << "=================" << std::endl;

0 commit comments

Comments
 (0)