Page MenuHomePhabricator

[Profiling] Speed up unittests by ~5x

Authored by vsk on Jan 29 2016, 8:36 AM.



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

Diff Detail

Event Timeline

vsk updated this revision to Diff 46387.Jan 29 2016, 8:36 AM
vsk retitled this revision from to [Profiling] Speed up unittests by ~5x.
vsk updated this object.
vsk added a reviewer: davidxl.
vsk added a subscriber: llvm-commits.
davidxl accepted this revision.Jan 29 2016, 9:01 AM
davidxl edited edge metadata.


This revision is now accepted and ready to land.Jan 29 2016, 9:01 AM

If we're asking the question - why does this need to be 1024? What's the
specific purpose of the iteration? (why would 1 be too few iterations, for

vsk updated this revision to Diff 46453.Jan 29 2016, 5:00 PM
vsk edited edge metadata.

Address some of @dblaikie's concerns:

  • Only test doCompression = true.
  • Move away from a statistical approach.
vsk updated this revision to Diff 46454.Jan 29 2016, 5:04 PM
  • Rangify loops.

please do not remove the no compression path. I think we should just keep your original change of making the iteration to a smaller number. With the latest change plus 1024 iteration, the test time is ~20ms. I am ok with shorten the iteration further if we think 20ms is too costly.

I took the liberty to further reduce the test time down to ~6ms.

vsk abandoned this revision.Feb 24 2016, 6:26 PM

Deferring to David's preference on this one.