From 740667a1c5fa0188bb676c569064deb2c47c0825 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Tue, 15 Sep 2015 17:55:06 -0700 Subject: ART: Skip compiler-driver compile loop for VerifyAtRuntime We don't compile (not even dex-to-dex) anyways, so skip iterating over all methods. Shows a ~10% improvement of boot image compile time on Nexus 9. Shows a ~40% improvement for a common large app on the same device. Most of the remaining time is unzipping dex files. Bug: 24103765 Change-Id: I00931fd062a0a2297d1c7b90794302cb664571cc --- compiler/driver/compiler_driver.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'compiler/driver/compiler_driver.cc') diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index 4c1408a177..750e912da3 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -490,8 +490,18 @@ void CompilerDriver::CompileAll(jobject class_loader, std::unique_ptr thread_pool( new ThreadPool("Compiler driver thread pool", thread_count_ - 1)); VLOG(compiler) << "Before precompile " << GetMemoryUsageString(false); + // Precompile: + // 1) Load image classes + // 2) Resolve all classes + // 3) Attempt to verify all classes + // 4) Attempt to initialize image classes, and trivially initialized classes PreCompile(class_loader, dex_files, thread_pool.get(), timings); - Compile(class_loader, dex_files, thread_pool.get(), timings); + // Compile: + // 1) Compile all classes and methods enabled for compilation. May fall back to dex-to-dex + // compilation. + if (!GetCompilerOptions().VerifyAtRuntime()) { + Compile(class_loader, dex_files, thread_pool.get(), timings); + } if (dump_stats_) { stats_->Dump(); } -- cgit v1.2.3-59-g8ed1b