From f91fc1220f1b77c55317ff50f4dde8e6b043858f Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Wed, 13 May 2020 09:21:00 +0100 Subject: Optimizing: Run gtests without creating the Runtime. The only Optimizing test that actually needs a Runtime is the ReferenceTypePropagationTest, so we make it subclass CommonCompilerTest explicitly and change OptimizingUnitTest to subclass CommonArtTest for the other tests. On host, each test that initializes the Runtime takes ~220ms more than without initializing the Runtime. For example, the ConstantFoldingTest that has 10 individual tests previously took over 2.2s to run but without the Runtime initialization it takes around 3-5ms. On target, running 32-bit gtests on taimen with run-gtests.sh (single-threaded) goes from ~28m47s to ~26m13s, a reduction of ~9%. Test: m test-art-host-gtest Test: run-gtests.sh Change-Id: I43e50ed58e52cc0ad04cdb4d39801bfbae840a3d --- compiler/optimizing/liveness_test.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'compiler/optimizing/liveness_test.cc') diff --git a/compiler/optimizing/liveness_test.cc b/compiler/optimizing/liveness_test.cc index f11f7a9779..ba3787e9be 100644 --- a/compiler/optimizing/liveness_test.cc +++ b/compiler/optimizing/liveness_test.cc @@ -47,8 +47,10 @@ static void DumpBitVector(BitVector* vector, void LivenessTest::TestCode(const std::vector& data, const char* expected) { HGraph* graph = CreateCFG(data); // `Inline` conditions into ifs. - PrepareForRegisterAllocation(graph, *compiler_options_).Run(); - std::unique_ptr codegen = CodeGenerator::Create(graph, *compiler_options_); + std::unique_ptr compiler_options = + CommonCompilerTest::CreateCompilerOptions(kRuntimeISA, "default"); + PrepareForRegisterAllocation(graph, *compiler_options).Run(); + std::unique_ptr codegen = CodeGenerator::Create(graph, *compiler_options); SsaLivenessAnalysis liveness(graph, codegen.get(), GetScopedAllocator()); liveness.Analyze(); -- cgit v1.2.3-59-g8ed1b