diff options
| author | Jesse Wilson <jessewilson@google.com> | 2010-10-13 16:59:12 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-10-13 16:59:12 -0700 |
| commit | 3394db7d9432053e56d86b3f24e64deeb3099950 (patch) | |
| tree | 5c3f4108526de568b18a583e0be61b7ac1b29d26 /tools/preload/WritePreloadedClassFile.java | |
| parent | a31cbd61bc53730d756464b0c273475c4f738066 (diff) | |
| parent | eaca10e2d0a61c482b6a1799ca9f51d8f67482cb (diff) | |
| download | frameworks_base-3394db7d9432053e56d86b3f24e64deeb3099950.zip frameworks_base-3394db7d9432053e56d86b3f24e64deeb3099950.tar.gz frameworks_base-3394db7d9432053e56d86b3f24e64deeb3099950.tar.bz2 | |
Merge "Regenerate preloaded classes for Gingerbread." into gingerbread
Diffstat (limited to 'tools/preload/WritePreloadedClassFile.java')
| -rw-r--r-- | tools/preload/WritePreloadedClassFile.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/preload/WritePreloadedClassFile.java b/tools/preload/WritePreloadedClassFile.java index 96c539b..b067bc2 100644 --- a/tools/preload/WritePreloadedClassFile.java +++ b/tools/preload/WritePreloadedClassFile.java @@ -34,6 +34,11 @@ public class WritePreloadedClassFile { */ static final int MIN_LOAD_TIME_MICROS = 1250; + /** + * Preload any class that was loaded by at least MIN_PROCESSES processes. + */ + static final int MIN_PROCESSES = 10; + public static void main(String[] args) throws IOException, ClassNotFoundException { if (args.length != 1) { @@ -58,6 +63,7 @@ public class WritePreloadedClassFile { out.write("# Automatically generated by frameworks/base/tools/preload/" + WritePreloadedClassFile.class.getSimpleName() + ".java.\n"); out.write("# MIN_LOAD_TIME_MICROS=" + MIN_LOAD_TIME_MICROS + "\n"); + out.write("# MIN_PROCESSES=" + MIN_PROCESSES + "\n"); /* * The set of classes to preload. We preload a class if: @@ -73,7 +79,12 @@ public class WritePreloadedClassFile { // the memory associated with these classes will be shared. for (LoadedClass loadedClass : root.loadedClasses.values()) { Set<String> names = loadedClass.processNames(); - if (shouldPreload(loadedClass) && names.size() > 1) { + if (!Policy.isPreloadable(loadedClass)) { + continue; + } + + if (names.size() >= MIN_PROCESSES || + (loadedClass.medianTimeMicros() > MIN_LOAD_TIME_MICROS && names.size() > 1)) { toPreload.add(loadedClass); } } |
