diff options
author | Christopher Tate <ctate@google.com> | 2011-11-11 15:47:21 -0800 |
---|---|---|
committer | Christopher Tate <ctate@google.com> | 2011-11-11 16:10:42 -0800 |
commit | 60201f2b4ee3fcf222310b5bf91d1d150470cab7 (patch) | |
tree | a11c3c0842975496f8e4ed4746b752b983f4e33a /core/java/android/content | |
parent | d400d03f4a6384449f8b0d3c8a9aa7e1e8aa5a16 (diff) | |
download | frameworks_base-60201f2b4ee3fcf222310b5bf91d1d150470cab7.zip frameworks_base-60201f2b4ee3fcf222310b5bf91d1d150470cab7.tar.gz frameworks_base-60201f2b4ee3fcf222310b5bf91d1d150470cab7.tar.bz2 |
XML parsing optimizations
Traceview showed approximately 10% of total parse time inside the
synthetic 'trampoline' methods generated to provide inner classes
with access to their outer class's private fields. The bottleneck
in this particular case is in XmlBlock and its inner class Parser.
Making the bottlneck outer-class members and methods package-scope
instead of private removes that 10% overhead being spent within
these access trampolines.
Traceview tends to overemphasize the significance of very small
methods such as these trampolines. That said, the measured speed
gain on the ParseLargeXmlResFg op due to this patch is between
5% and 6%.
Change-Id: Ia0e3ae5408d1f9992b46e6e30dd2407090379b07
Diffstat (limited to 'core/java/android/content')
-rw-r--r-- | core/java/android/content/res/XmlBlock.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/java/android/content/res/XmlBlock.java b/core/java/android/content/res/XmlBlock.java index ad1bfb2..bea6529 100644 --- a/core/java/android/content/res/XmlBlock.java +++ b/core/java/android/content/res/XmlBlock.java @@ -484,7 +484,7 @@ final class XmlBlock { private final AssetManager mAssets; private final int mNative; - private final StringBlock mStrings; + /*package*/ final StringBlock mStrings; private boolean mOpen = true; private int mOpenCount = 1; @@ -494,9 +494,9 @@ final class XmlBlock { private static final native int nativeGetStringBlock(int obj); private static final native int nativeCreateParseState(int obj); - private static final native int nativeNext(int state); + /*package*/ static final native int nativeNext(int state); private static final native int nativeGetNamespace(int state); - private static final native int nativeGetName(int state); + /*package*/ static final native int nativeGetName(int state); private static final native int nativeGetText(int state); private static final native int nativeGetLineNumber(int state); private static final native int nativeGetAttributeCount(int state); |