summaryrefslogtreecommitdiffstats
path: root/tools/preload
diff options
context:
space:
mode:
authorJesse Wilson <jessewilson@google.com>2011-01-21 17:12:43 -0800
committerJesse Wilson <jessewilson@google.com>2011-01-21 17:25:55 -0800
commit8068618ebed021c445db0919843cdb6b9b9e35b5 (patch)
tree8673dab9f76e20405a50fbbcfa0834258ca3d947 /tools/preload
parent7633540cf0d1cfa1f893dc827cddaca3ea272af7 (diff)
downloadframeworks_base-8068618ebed021c445db0919843cdb6b9b9e35b5.zip
frameworks_base-8068618ebed021c445db0919843cdb6b9b9e35b5.tar.gz
frameworks_base-8068618ebed021c445db0919843cdb6b9b9e35b5.tar.bz2
Update preloaded-classes for Honeycomb.
We preload classes for two reasons. Classes that are popular can be shared and can increase the number of apps that can be run concurrently. Classes that initialize slowly can be initialized at system boot time by the zygote, decreasing the time to launch a specific app. To select which classes to preload, I exercised Android's built-in apps as well as these apps from Market: ESPN score center, Amazon, Flixster, Twitter, Adobe Reader, Ebay Mobile, Facebook, Solitare (Ken Magic), Barcode Reader, Google Earth and Square. A cycle of launching ~460 (non unique) activities in sequence took 9m35s with the previous preloaded-classes list. The update improves the launch time of the same sequence to 9m27s: the marginal improvement over the previous set of preloaded classes is negligible. http://b/3004763 Change-Id: Ida511ae31eeff6d95d9cb6aacae68b9bb9dd2ebe
Diffstat (limited to 'tools/preload')
-rw-r--r--tools/preload/Record.java22
1 files changed, 12 insertions, 10 deletions
diff --git a/tools/preload/Record.java b/tools/preload/Record.java
index 9d45a26..2f2ffaf 100644
--- a/tools/preload/Record.java
+++ b/tools/preload/Record.java
@@ -30,6 +30,8 @@ class Record {
"com.google.android.apps.maps\\u003Adriveabout",
"com.google.android.apps.maps:LocationFriendService",
"com.google.android.apps.maps\\u003ALocationFriendService",
+ "com.google.android.apps.maps:NetworkLocationService",
+ "com.google.android.apps.maps\\u003ANetworkLocationService",
};
enum Type {
@@ -69,7 +71,7 @@ class Record {
/** Record time (ns). */
final long time;
-
+
/** Source file line# */
int sourceLineNumber;
@@ -91,7 +93,7 @@ class Record {
for (int i = 0; i < REPLACE_CLASSES.length; i+= 2) {
line = line.replace(REPLACE_CLASSES[i], REPLACE_CLASSES[i+1]);
}
-
+
line = line.substring(1);
String[] parts = line.split(":");
@@ -106,12 +108,12 @@ class Record {
time = Long.parseLong(parts[6]);
}
-
+
/**
* Decode any escaping that may have been written to the log line.
- *
+ *
* Supports unicode-style escaping: \\uXXXX = character in hex
- *
+ *
* @param rawField the field as it was written into the log
* @result the same field with any escaped characters replaced
*/
@@ -122,11 +124,11 @@ class Record {
String before = result.substring(0, offset);
String escaped = result.substring(offset+2, offset+6);
String after = result.substring(offset+6);
-
+
result = String.format("%s%c%s", before, Integer.parseInt(escaped, 16), after);
- // find another but don't recurse
- offset = result.indexOf("\\u", offset + 1);
+ // find another but don't recurse
+ offset = result.indexOf("\\u", offset + 1);
}
return result;
}
@@ -135,13 +137,13 @@ class Record {
* Converts a VM-style name to a language-style name.
*/
String vmTypeToLanguage(String typeName) {
- // if the typename is (null), just return it as-is. This is probably in dexopt and
+ // if the typename is (null), just return it as-is. This is probably in dexopt and
// will be discarded anyway. NOTE: This corresponds to the case in dalvik/vm/oo/Class.c
// where dvmLinkClass() returns false and we clean up and exit.
if ("(null)".equals(typeName)) {
return typeName;
}
-
+
if (!typeName.startsWith("L") || !typeName.endsWith(";") ) {
throw new AssertionError("Bad name: " + typeName + " in line " + sourceLineNumber);
}