History log of /art/runtime/base/stringpiece.h
Revision Date Author Comments
de40d478930d0889a2aea5cbf58aa63da24e5dfa 16-Oct-2015 Mathieu Chartier <mathieuc@google.com> 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
e2aa3265594486b4b977453752645cdce3026e82 21-Oct-2015 Mathieu Chartier <mathieuc@google.com> Use binary search for FindDeclaredInstance/StaticField

Before:
real 1m18.157s
user 1m8.167s
sys 0m8.071s

After:
real 1m12.943s
user 1m3.223s
sys 0m7.881s

Perf results:
FindDeclaredStaticField: 1.78% -> 0.11%
__GI___strncmp_ssse3: 2.45% -> 0.87%

Bug: 10921004

Change-Id: Ice7d3ce2635d6cd2de5574055375d9e20712d241
277ccbd200ea43590dfc06a93ae184a765327ad0 04-Nov-2014 Andreas Gampe <agampe@google.com> ART: More warnings

Enable -Wno-conversion-null, -Wredundant-decls and -Wshadow in general,
and -Wunused-but-set-parameter for GCC builds.

Change-Id: I81bbdd762213444673c65d85edae594a523836e5
6b604a1b0289e5e7211c2e5f8c4f395f51de7c3d 26-Sep-2014 Ian Rogers <irogers@google.com> Fix Class::IsInSamePackage to not read beyond the end of a StringPiece.

Fix length of string piece to be size_type rather than int because expecting
negatively sized strings is a bad idea and we should use unsigned types to
defensively guard against mistakes.
Remove max_size and capacity since the return type is inconsistent between
Google and the STL, and we don't need the functions.
Add a bound check in libartd to operator[] accesses.

Change-Id: I1b87a03d8fbd95e7dbb106745e304d1083898075
7b078e8c04f3e1451dbdd18543c8b9692b5b067e 10-Sep-2014 Ian Rogers <irogers@google.com> Compile time performance improvements focusing on interpret-only.

Reduce virtual method dispatch in the method verifier and make more code
inline-able.
Add a StringPiece with const char* equality operator to avoid redundant
StringPieces and strlens.
Remove back link from register line to verifier and pass as argument to reduce
size of RegisterLine.
Remove instruction length from instruction flags and compute from the
instruction, again to reduce size.
Add suspend checks to resolve and verify to allow for more easy monitor
inflation and reduce contention on Locks::thread_list_suspend_thread_lock_.
Change ThrowEarlierClassFailure to throw pre-allocated exception.
Avoid calls to Thread::Current() by passing self.
Template specialize IsValidClassName.
Make ANR reporting with SIGQUIT run using checkpoints rather than suspending
all threads. This makes the stack/lock analysis less lock error prone.
Extra Barrier assertions and condition variable time out is now returned as a
boolean both from Barrier and ConditionVariable::Wait.

2 threaded host x86-64 interpret-only numbers from 341 samples:
Before change: Avg 176.137ms 99% CI 3.468ms to 1060.770ms
After change: Avg 139.163% 99% CI 3.027ms to 838.257ms
Reduction in average compile time after change is 20.9%.
Slow-down without change is 26.5%.

Bug: 17471626 - Fix bug where RegTypeCache::JavaLangObject/String/Class/Throwable
could return unresolved type when class loading is disabled.
Bug: 17398101

Change-Id: Id59ce3cc520701c6ecf612f7152498107bc40684
7dfb28c066159e6cde8181720f0c451a700ef966 22-Aug-2013 Ian Rogers <irogers@google.com> Don't scan image space when starting runtime.

Bug 10432288.
Find Classes and Strings from dex caches lazily rather than when the image is
loaded.
Make class status changes do notifies when there can be waiters.
For Class lookup there's a pathology if we always search dex caches and
so after 1000 failures move all classes into the class table.
Be consistent in using "const char*" for class linker descriptors as this
most easily agrees with the type in the dex file.
Improve the intern run-test so that it has a case of a literal contained in the
image.
Modify image_test to allow any valid lock word rather than expecting 0, ideally
we wouldn't see inflated monitors but we do due to NotifyAll (see bug 6961405).

Change-Id: Ia9bfa748eeccb9b4498784b97c6823141b1f6db8
fc0e3219edc9a5bf81b166e82fd5db2796eb6a0d 17-Jul-2013 Brian Carlstrom <bdc@google.com> Fix multiple inclusion guards to match new pathnames

Change-Id: Id7735be1d75bc315733b1773fba45c1deb8ace43
7940e44f4517de5e2634a7e07d58d0fb26160513 12-Jul-2013 Brian Carlstrom <bdc@google.com> Create separate Android.mk for main build targets

The runtime, compiler, dex2oat, and oatdump now are in seperate trees
to prevent dependency creep. They can now be individually built
without rebuilding the rest of the art projects. dalvikvm and jdwpspy
were already this way. Builds in the art directory should behave as
before, building everything including tests.

Change-Id: Ic6b1151e5ed0f823c3dd301afd2b13eb2d8feb81