This is an archive of the discontinued LLVM Phabricator instance.

[libcxxabi] Refactor test timing logic and disable by default.
ClosedPublic

Authored by EricWF on Nov 24 2014, 12:57 PM.

Details

Summary

When using LIT the timing output is entirely unused but introduces a dependency on <chrono>. When libc++ is built without a montonic clock this causes some of the tests to fail.
This patch factors out all of the timing logic into support/timer.hpp and disables it by default. To enable the timing you must define LIBCXXABI_TIME_TESTS.

Diff Detail

Event Timeline

EricWF updated this revision to Diff 16577.Nov 24 2014, 12:57 PM
EricWF retitled this revision from to [libcxxabi] Refactor test timing logic and disable by default..
EricWF updated this object.
EricWF edited the test plan for this revision. (Show Details)
EricWF added reviewers: mclow.lists, danalbert, jroelofs.
EricWF added a subscriber: Unknown Object (MLST).
jroelofs edited edge metadata.Nov 24 2014, 1:08 PM

These are still useful to make sure we don't regress too badly on typeinfo lookup performance, so I think we should default this to 'on'.

Then we can turn it off in the configurations where it makes for unnecessary failures (like on my baremetal stuff where there isn't a monotonic clock).

It is a bit lame that we don't have a way to automatically catch changes in the perf numbers that come out of this though. Any ideas on how to fix that?

In D6391#4, @jroelofs wrote:

These are still useful to make sure we don't regress too badly on typeinfo lookup performance, so I think we should default this to 'on'.

Then we can turn it off in the configurations where it makes for unnecessary failures (like on my baremetal stuff where there isn't a monotonic clock).

Sounds good. I'll make the change.

It is a bit lame that we don't have a way to automatically catch changes in the perf numbers that come out of this though. Any ideas on how to fix that?

Yes. Once the suffix test patch gets through review I'm going to start working on something. I actually have an internship starting in January to solve exactly this problem.

EricWF updated this revision to Diff 16583.Nov 24 2014, 2:23 PM
EricWF edited edge metadata.

Somewhat address @jroelofs comments. The timers are enabled by default EXCEPT when using LIT. Since there is currently no way in LIT to show the output it doesn't make sense to introduce the <chrono> dependency.

jroelofs accepted this revision.Nov 24 2014, 2:31 PM
jroelofs edited edge metadata.

LGTM

test/test_demangle.cpp
15

I think this include should go at the top.

This revision is now accepted and ready to land.Nov 24 2014, 2:31 PM
EricWF closed this revision.Nov 24 2014, 2:39 PM