[libc-commits] [PATCH] D128995: [libc][math] Improved ExhaustiveTest performance.

Tue Ly via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri Jul 1 08:35:31 PDT 2022

lntue added inline comments.

Comment at: libc/test/src/math/exhaustive/exhaustive_test.cpp:51
+          std::lock_guard<std::mutex> lock(mx_cout);
+          std::cout << new_percent << "% is in process     \r" << std::flush;
+        }
orex wrote:
> lntue wrote:
> > It is actually convenient to display the tested range whether it passed or not, so that we can save time by only running the failed ranges again while developing.  Also if you build the message separately before passing all at once to `std::cout`, you will not need this lock, since a single `<<` for `std::cout` is guaranteed to be atomic.
> That will be a lot of ranges, which is passed. I don't think it will be good to display them. Also you always have a values, which is not passed from testing macros, so you can use them to check problems. 
Or just display the failed ranges?  So that you can redirect the outputs to a file and find the exact / smallest ranges to skip all the passed one?  Actually with your default option, `2^12` ranges is not too bad for output to a file.

  rG LLVM Github Monorepo



More information about the libc-commits mailing list