summaryrefslogtreecommitdiff
path: root/runtime/class_linker.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2023-01-04 14:06:38 +0000
committer Treehugger Robot <treehugger-gerrit@google.com> 2023-01-09 10:16:30 +0000
commit0474095317768c79b360917883f12f351356bfea (patch)
tree7f480a7824ce94b293b0f5b66ed072c9b1380d35 /runtime/class_linker.cc
parent8008d6b69ac22d3736aa16c86217d6ecf43927db (diff)
Make classes visibly initialized in bigger batches.
Change the batch size from 16 to 48. This should make app startup faster for apps that initialize a lot of classes. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 38383823 Change-Id: If6387dab27887b7380e30ee6e8b3376158ff04de
Diffstat (limited to 'runtime/class_linker.cc')
-rw-r--r--runtime/class_linker.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index a2d07a5a7e..b98f704af3 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -299,7 +299,13 @@ class ClassLinker::VisiblyInitializedCallback final
}
}
- static constexpr size_t kMaxClasses = 16;
+ // Making classes initialized in bigger batches helps with app startup for
+ // apps that initialize a lot of classes by running fewer checkpoints.
+ // (On the other hand, bigger batches make class initialization checks more
+ // likely to take a slow path but that is mitigated by making partially
+ // filled buffers visibly initialized if we take the slow path many times.
+ // See `Thread::kMakeVisiblyInitializedCounterTriggerCount`.)
+ static constexpr size_t kMaxClasses = 48;
ClassLinker* const class_linker_;
size_t num_classes_;