Use arenas for the verifier
Improvements are from using arenas for verifier. The things that
were moved into arenas are register lines, reg types, and reg type
descriptors.
Also some minor cleanup. Fixed double space formatting error in
string piece.
========================================
Before:
=======================================
compile GmsCore 50x on host -j1:
real 3m5.510s
user 2m48.139s
sys 0m11.753s
50 random APKs:
real 1m18.157s
user 1m8.167s
sys 0m8.071s
RAM (GmsCore):
(threads: 1) arena alloc=0B java alloc=27MB native alloc=64MB free=792KB
(threads: 4) arena alloc=0B java alloc=27MB native alloc=64MB free=397KB
Perf:
=============================
After:
=============================
compile GmsCore 50x on host -j1:
real 2m31.455s
user 2m14.784s
sys 0m10.888s
50 random APKs:
Speed up from arena allocating:
real 1m12.094s
user 1m2.325s
sys 0m7.872s
Speed up from areans + CreateFindClassDefIndex + unordered_map for DexFileVerifier.
real 1m8.654s
user 0m58.955s
sys 0m7.777s
RAM (GmsCore):
(threads: 1) arena alloc=1049KB java alloc=27MB native alloc=65MB free=538KB
(threads: 4) arena alloc=4MB java alloc=27MB native alloc=69MB free=650KB
Perf on host key results:
_int_malloc: 3.60% -> 1.39%
malloc: 1.48% -> 0.65%
_int_free: 1.59% -> 0.61%
RegTypeCache::FromClass: 1.47% -> 0.86%
malloc_consolidate: 0.89% -> 0.63%
Real speed up is ~22% on GmsCore, ~14% on the set of 60 APKs.
Bug: 10921004
Change-Id: If13d4ab4284a176f93a26a412549b6b1149dfb16
diff --git a/runtime/base/stringpiece.h b/runtime/base/stringpiece.h
index 9c83cf5..46743e9 100644
--- a/runtime/base/stringpiece.h
+++ b/runtime/base/stringpiece.h
@@ -165,7 +165,7 @@
// Pointer to char data, not necessarily zero terminated.
const char* ptr_;
// Length of data.
- size_type length_;
+ size_type length_;
};
// This large function is defined inline so that in a fairly common case where