From f67e8c35ee11b0bd81a2d6f6e267b9081db7d758 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Thu, 17 Mar 2022 12:55:27 +0000 Subject: Preallocate `CodeInfoTableDeduper::dedupe_set_`. Preallocate large buffer except for multi-image compilation which requires multiple dedupe sets, so we let them grow as needed without wasting too much memory. We do not expect to use multi-image compilation on user devices. Also remove the hash from the dedupe set entry. With the large pre-allocated buffer, we have very few hash conflicts and comparing the hash just slows down finding identical entries. If we exceed the pre-allocated buffer, this shall trade some performance for lower memory use. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 181943478 Change-Id: Ibbb98b6d3ebbc35ffa75165baad54f4df7c62ad9 --- compiler/driver/compiler_options.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'compiler/driver/compiler_options.h') diff --git a/compiler/driver/compiler_options.h b/compiler/driver/compiler_options.h index 783092431a..0034306fdf 100644 --- a/compiler/driver/compiler_options.h +++ b/compiler/driver/compiler_options.h @@ -233,6 +233,10 @@ class CompilerOptions final { return image_type_ == ImageType::kAppImage; } + bool IsMultiImage() const { + return multi_image_; + } + // Returns whether we are running ART tests. // The compiler will use that information for checking invariants. bool CompileArtTest() const { @@ -408,6 +412,7 @@ class CompilerOptions final { CompilerType compiler_type_; ImageType image_type_; + bool multi_image_; bool compile_art_test_; bool baseline_; bool debuggable_; -- cgit v1.2.3-59-g8ed1b