Make duplicate intern string check be debug only
This check was expensive and costing up to 300ms per dex2oat
invocation. Disabling the check reduces OTA/first boot time by
~10-20s for low preopt devices.
Test: test-art-host
Bug: 70934104
Change-Id: I7ed0a0d098bc725c6fbb24318b73816506c2deec
diff --git a/runtime/intern_table.cc b/runtime/intern_table.cc
index 4b964f6..2db8815 100644
--- a/runtime/intern_table.cc
+++ b/runtime/intern_table.cc
@@ -371,7 +371,7 @@
return read_count;
}
// TODO: Disable this for app images if app images have intern tables.
- static constexpr bool kCheckDuplicates = true;
+ static constexpr bool kCheckDuplicates = kIsDebugBuild;
if (kCheckDuplicates) {
for (GcRoot<mirror::String>& string : set) {
CHECK(Find(string.Read()) == nullptr) << "Already found " << string.Read()->ToModifiedUtf8();