]> granicus.if.org Git - clang/commit
Don't instantiate a full host toolchain in ASTMatchersTest.
authorJustin Lebar <jlebar@google.com>
Thu, 30 Jun 2016 18:12:25 +0000 (18:12 +0000)
committerJustin Lebar <jlebar@google.com>
Thu, 30 Jun 2016 18:12:25 +0000 (18:12 +0000)
commit909f14ac45a043ba03cd95a119d7521573fb219a
tree8af7bdd97dfb5a1fbc8fb7ded8272f59546296be
parent007ae0afb873fe3bba2bf5a9db77fae267679f92
Don't instantiate a full host toolchain in ASTMatchersTest.

Summary:
This test was stat()'ing large swaths of /usr/lib hundreds of times, as
every invocation of matchesConditionally*() created a new Linux
toolchain.

In addition to being slow, perf indicated this was causing substantial
contention in the kernel.

Something is...interesting in the kernel, as without this patch I
sometimes see ~11m spent in the kernel, and sometimes ~5m.  This
corresponds to bimodal ninja check-clang times of ~30s and ~20s.

It's not clear to me exactly what causes the bimodality.  In any case,
this change makes this test run in 2.5s, down from 17s, and it seems to
cause us to get the 20s ninja check-clang time unconditionally.

Reviewers: chandlerc

Subscribers: cfe-commits, klimek

Differential Revision: http://reviews.llvm.org/D21810

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274257 91177308-0d34-0410-b5e6-96231b3b80d8
unittests/ASTMatchers/ASTMatchersTest.h