]> git.sesse.net Git - plocate/commitdiff
When failing the benchmark tests, stop printing out differences after the first ten.
authorSteinar H. Gunderson <steinar+git@gunderson.no>
Sun, 4 Oct 2020 22:32:43 +0000 (00:32 +0200)
committerSteinar H. Gunderson <steinar+git@gunderson.no>
Sun, 4 Oct 2020 22:32:43 +0000 (00:32 +0200)
bench.cpp

index 46b6ed00912a7e68af1facdf767e890ac431145e..d9704ef53a71ca203578047ec372605837e81feb 100644 (file)
--- 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;
                        }
                }