From: Steinar H. Gunderson Date: Sun, 4 Oct 2020 22:32:43 +0000 (+0200) Subject: When failing the benchmark tests, stop printing out differences after the first ten. X-Git-Tag: 1.0.0~57 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=55e4df337691b625b3b9af9cfea4630204d5ceec;p=plocate When failing the benchmark tests, stop printing out differences after the first ten. --- diff --git a/bench.cpp b/bench.cpp index 46b6ed0..d9704ef 100644 --- a/bench.cpp +++ b/bench.cpp @@ -56,10 +56,11 @@ int main(void) decode_pfor_delta1<128>(pldata, num_docids, &out2[0]); for (unsigned i = 0; i < num_docids; ++i) { if (out1[i] != out2[i]) { - for (unsigned j = 0; j < num_docids; ++j) { - fprintf(stderr, "%3u: reference=%u ours=%u (diff=%d)\n", j, out1[j], out2[j], out1[j] - out2[j]); + if (++num_errors < 10) { + for (unsigned j = 0; j < num_docids; ++j) { + fprintf(stderr, "%3u: reference=%u ours=%u (diff=%d)\n", j, out1[j], out2[j], out1[j] - out2[j]); + } } - ++num_errors; break; } }