diff options
| author | 2014-08-19 14:29:46 -0700 | |
|---|---|---|
| committer | 2014-08-26 15:28:07 -0700 | |
| commit | 8e219ae27624116b6d23e858fb21e93342f81d66 (patch) | |
| tree | a685be4079ff6c506630b720eb50226d16848005 /compiler/driver/compiler_driver.cc | |
| parent | 0b05ec674139c2b2e0914b0bb0e1898f93a9c852 (diff) | |
Reduce interpret-only compile time.
Before:
39.04user 5.18system 0:29.24elapsed 151%CPU (0avgtext+0avgdata 164176maxresident)k
38.87user 5.16system 0:29.14elapsed 151%CPU (0avgtext+0avgdata 164144maxresident)k
After:
36.26user 3.25system 0:27.00elapsed 146%CPU (0avgtext+0avgdata 162592maxresident)k
36.25user 3.28system 0:26.28elapsed 150%CPU (0avgtext+0avgdata 162688maxresident)k
Disabled implicit stack protection for the compiler, this reduces page faults.
Added support for not timing every method compilation and verification. NanoTime is
slow and adds ~2 seconds of real time. This is currently enabled since people want
to know which methods are slow to compile.
Bug: 16853450
Change-Id: I349ffb3f36db8c437137387aa6914dc17d743f09
Diffstat (limited to 'compiler/driver/compiler_driver.cc')
| -rw-r--r-- | compiler/driver/compiler_driver.cc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index d1458bcf08..ec3955b1f5 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -61,6 +61,8 @@ namespace art { +static constexpr bool kTimeCompileMethod = !kIsDebugBuild; + static double Percentage(size_t x, size_t y) { return 100.0 * (static_cast<double>(x)) / (static_cast<double>(x + y)); } @@ -2024,7 +2026,7 @@ void CompilerDriver::CompileMethod(const DexFile::CodeItem* code_item, uint32_t const DexFile& dex_file, DexToDexCompilationLevel dex_to_dex_compilation_level) { CompiledMethod* compiled_method = NULL; - uint64_t start_ns = NanoTime(); + uint64_t start_ns = kTimeCompileMethod ? NanoTime() : 0; if ((access_flags & kAccNative) != 0) { // Are we interpreting only and have support for generic JNI down calls? @@ -2052,10 +2054,12 @@ void CompilerDriver::CompileMethod(const DexFile::CodeItem* code_item, uint32_t dex_to_dex_compilation_level); } } - uint64_t duration_ns = NanoTime() - start_ns; - if (duration_ns > MsToNs(compiler_->GetMaximumCompilationTimeBeforeWarning()) && !kIsDebugBuild) { - LOG(WARNING) << "Compilation of " << PrettyMethod(method_idx, dex_file) - << " took " << PrettyDuration(duration_ns); + if (kTimeCompileMethod) { + uint64_t duration_ns = NanoTime() - start_ns; + if (duration_ns > MsToNs(compiler_->GetMaximumCompilationTimeBeforeWarning())) { + LOG(WARNING) << "Compilation of " << PrettyMethod(method_idx, dex_file) + << " took " << PrettyDuration(duration_ns); + } } Thread* self = Thread::Current(); |