[PATCH] D16726: [Profiling] Speed up unittests by ~5x

Vedant Kumar via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 29 08:36:36 PST 2016


vsk created this revision.
vsk added a reviewer: davidxl.
vsk added a subscriber: llvm-commits.

I noticed that this particular unit test takes a relatively long time to run. Is it OK to shorten it?

http://reviews.llvm.org/D16726

Files:
  unittests/ProfileData/InstrProfTest.cpp

Index: unittests/ProfileData/InstrProfTest.cpp
===================================================================
--- unittests/ProfileData/InstrProfTest.cpp
+++ unittests/ProfileData/InstrProfTest.cpp
@@ -700,7 +700,7 @@
 TEST_F(InstrProfTest, instr_prof_symtab_compression_test) {
   std::vector<std::string> FuncNames1;
   std::vector<std::string> FuncNames2;
-  for (int I = 0; I < 10 * 1024; I++) {
+  for (int I = 0; I < 1024; I++) {
     std::string str;
     raw_string_ostream OS(str);
     OS << "func_" << I;
@@ -755,7 +755,7 @@
       ASSERT_EQ(StringRef("BAR_50"), R);
       R = Symtab.getFuncName(IndexedInstrProf::ComputeHash(FuncNames2[101]));
       ASSERT_EQ(StringRef("BlahblahBlahblahBar_50"), R);
-      for (int I = 0; I < 10 * 1024; I++) {
+      for (int I = 0; I < 1024; I++) {
         std::string N[4];
         N[0] = FuncNames1[2 * I];
         N[1] = FuncNames1[2 * I + 1];


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16726.46387.patch
Type: text/x-patch
Size: 906 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160129/9e4de61a/attachment.bin>


More information about the llvm-commits mailing list