17 Commits

Author SHA1 Message Date
Siyamed Sinir
fa05ba0b0d Sort the result of SpannableStringBuilder.getSpans
SpannableStringBuilder used to return the result of getSpans in the
order of start indices because of the interval tree it uses. However,
style spans has to be applied in the order of insertion to get
predictable results. Sorted the results of getSpans ordered first by
priority flag and then by insertion time. Moreover improved the
performance of SpannableStringInternal copy constructor.

Bug: 26240132
Change-Id: I0b0fa7bb30a3bd9ca37dedca66d8993718586027
2016-01-20 16:27:39 -08:00
Paul Duffin
cde2287208 Merge "Remove framework from LOCAL_JAVA_LIBRARIES" am: e252149ab9 am: ec9081a004
am: e94e7dd181

* commit 'e94e7dd181fb1857bf7aa3b807b64d9bb231edc6':
  Remove framework from LOCAL_JAVA_LIBRARIES
2015-12-08 14:22:55 +00:00
Paul Duffin
b12a3fca7e Remove framework from LOCAL_JAVA_LIBRARIES
After previous change removed LOCAL_NO_STANDARD_LIBRARIES:=true
it is no longer necessary to explicitly add framework to
LOCAL_JAVA_LIBRARIES as it is added automatically by the build.

Change-Id: I68bf700375e34a10302f76d7463110755b815f85
2015-12-08 13:59:36 +00:00
Andreas Gampe
32f4043ac3 Follow-up to Switch to the latest version of Caliper
Remove LOCAL_NO_STANDARD_LIBRARIES.

(cherry pick from commit c9d6a91cd51a9b7ff00187914fe922b0d22b3d66)

Bug: 24848946
Change-Id: I19feea042c9b4823d4979f4d951476792600edbc
2015-12-08 13:58:08 +00:00
Andreas Gampe
c373adb84d Merge "Follow-up to Switch to the latest version of Caliper" 2015-12-08 02:30:21 +00:00
Andreas Gampe
0fe2de958a Follow-up to Switch to the latest version of Caliper
Translate ResourcesBenchmark to work with the new version of Caliper.

Bug: 24848946
Change-Id: If4a4e5da5cd14da83d093a418147ad6d12c170cc
2015-12-07 18:25:10 -08:00
Andreas Gampe
c9d6a91cd5 Follow-up to Switch to the latest version of Caliper
Remove LOCAL_NO_STANDARD_LIBRARIES.

Bug: 24848946
Change-Id: I19feea042c9b4823d4979f4d951476792600edbc
2015-12-07 18:24:08 -08:00
Paul Duffin
6a75685258 Merge "Switch to the latest version of Caliper" am: ae119af517 am: 5e2d958157
am: 2a56ed70b1

* commit '2a56ed70b1e40039a532e4060074d62062713fcd':
  Switch to the latest version of Caliper
2015-12-07 23:58:26 +00:00
Paul Duffin
76a6cec97f Switch to the latest version of Caliper
Added an Android.mk file to core/tests/benchmarks to build the
benchmarks against caliper-api-target to ensure that they build
correctly. Changed the implementations to work with the new
version of Caliper.

Bug: 24848946
Change-Id: Ib28026816dbc5c1d54f65974f4a1abfee299c43f
2015-12-07 12:29:45 +00:00
Jeff Sharkey
46cfd93aa2 Let's sprinkle some FastJNI into Resources.
Before:

               benchmark   us linear runtime
                GetColor 14.9 ===========
              GetInteger 19.9 ===============
    GetLayoutAndTraverse 38.4 =============================
               GetString 38.5 ==============================

After:

               benchmark   us linear runtime
                GetColor 13.9 ==========
              GetInteger 18.8 ==============
    GetLayoutAndTraverse 38.1 =============================
               GetString 38.2 ==============================

Change-Id: I8c20e14182d2645bc62a0e7fc6345e298b11933c
2015-11-02 19:49:11 -08:00
Wenchao Tong
7ae35a0242 Create a Benchmark test for NetworkStats.
Bug: 19536273
Change-Id: I438ed3affa799612566b04e324e43bc5ea74079f
2015-03-23 16:34:03 -07:00
Nick Kralevich
7b3db39aa4 Replacing FloatMath native implementation with calls to Math
On modern versions of Android running in AOT mode
FloatMath is slower than Math. Calls to Math.sqrt(),
etc. are replaced by intrinsics which can be as small
as a single CPU opcode.

When running in interpreted mode the new
implementation is unfortunately slower, but I'm
judging this acceptable and likely to be improved
over time. This change saves a small amount of native
code.

Example timings:

Mako AOSP AOT:

Method: Original / New / Direct call to Math
ceil: 596ns / 146.ns / 111ns
sqrt: 694ns / 56ns / 25ns

Mako AOSP interpreted:

Method: Original / New / Direct call to Math
ceil: 1900ns / 2307ns / 1485ns
sqrt: 1998ns / 2603ns / 1788ns

Other calls Mako AOT:

Method: Original / New
cos: 635ns / 270ns
exp: 566ns / 324ns
floor: 604ns / 150ns
hypot: 631ns / 232ns
pow: 936ns / 643ns
sin: 641ns / 299ns

The advice to use Math directly, in preference to
FloatMath, is still good. FloatMath will be deprecated
separately.

Bug: https://code.google.com/p/android/issues/detail?id=36199
Change-Id: If07fcbd78543d13bc6d75f9743f999860e8d58d7
2014-10-20 09:24:11 +01:00
Jeff Sharkey
a2934d5ff0 Cache AndroidBlockGuardPolicy to avoid allocation.
Every incoming Binder call ends up triggering a BlockGuardPolicy
update, which would thrash between new AndroidBlockGuardPolicy
instances and BlockGuard.LAX_POLICY, causing GC churn.

This change avoids the extra allocations by recycling a single
AndroidBlockGuardPolicy in a ThreadLocal.  Worst-case thrashing case
is now 10% faster; from 7.46us to 6.65us.

Bug: 9424568
Change-Id: I9c3b1c097a2aecc9b1f109a824cf3ea319fb3393
2013-06-14 16:15:31 -07:00
Jeff Sharkey
8fa9bb5210 Benchmarks for IndentingPrintWriter.
Current timings on a mako listed below, which show minimal overhead
compared to writing directly. The increased code readability and
automatic indenting is worth the overhead.

Also worth noting is that writing concatenated strings is
substantially faster than printing components separately.

           benchmark      us linear runtime
       ComplexDirect 10712.7 =========================
    ComplexIndenting 12623.7 ==============================
       PairIndenting    45.8 =
             PairRaw    82.1 =
        SimpleDirect   282.2 =
     SimpleIndenting   294.4 =

Change-Id: I7c38690c14b017fa46248ebb0be69f6beff03371
2013-03-26 20:16:44 -07:00
Jeff Sharkey
9a2c2a6da9 Parse network stats using native code.
Switch to parsing detailed network stats with native code, which
is 71% faster than ProcFileReader.

Change-Id: I2525aaee74d227ce187ba3a74dd08a2b06514deb
2013-02-13 17:40:49 -08:00
Jeff Sharkey
92be93a94e Improve TrafficStats UID APIs.
Deprecate transport layer statistics, leaving only the summarized
network layer statistics.

Improve documentation to be clear about layers where measurements
occur, and their behavior since boot.  Under the hood, move to using
xt_qtaguid UID statistics.

Bug: 6818637, 7013662
Change-Id: I9f26992e5fcdebd88c671e5765bd91229e7b0016
2013-02-07 13:59:26 -08:00
Jeff Sharkey
a197e37f7f Caliper benchmarks for Parcel.
Bug: 6111276
Change-Id: I4b89e4c14d2dc20e71bbaed78f285e6d539a1f0f
2012-03-06 17:21:01 -08:00