summaryrefslogtreecommitdiff
path: root/benchmarks
AgeCommit message (Collapse)Author
2021-09-27Switch to OpenJDK 8 java/mathHans Boehm
The main goal here is performance by avoiding JNI and especially NativeAllocationRegistry overhead. We gain a factor of 10 or so on small BigInteger arithmetic. For large computations, we gain substantially in a few cases where OpenJDK seems to use better algorithms. AFAIK, with this version we never lose by integral factors relative to what we had before. A secondary goal is to clean out open BigInteger bugs. The base version is 8u252, which for this part of the tree is identical to June 15 2020 ToT. Note that this means we included the java.math part of https://hg.openjdk.java.net/jdk8u/jdk8u/jdk/rev/a5f5d7fd9be6 (29 Oct 2019) That appears to be a separable fix that makes no interface changes. I re-added @NonNull annotations. We also removed some code to write certain backwards-compatibility fields during serialization, since we never had those. This also adds a the <X>ValueExact Java 8 BigInteger methods that had not been previously supported. This removes a Harmony test for compatibility with the RI implementation that the RI implementation itself apparently fails. And, IMO, the observed behavior is better than what we previously tested for. Fixed a bunch of comment spelling errors. All of these have now been fixed in upstream ToT. Benchmarking showed that a straight move to the RI version slowed down large multiplications, divisions, and modular exponentiation enough to make it problematic. Thus I reintroduced NativeBN to allow those to fall back to boringssl, at least for sufficiently large inputs. It was moved to a hopefully more appropriate location. The fallback is tuned for 64 bits; for 32 bits it's probably much less useful; much of the boringssl performance advantage comes from 64-bit "digits". The boringssl fallbacks are not completely free, since we need extra conversions on each operation. But since we only do this for large asymptotically expensive computations, we see at mosts tens of percents regressions, which probably qualifies as "in the noise" here. If we find additional performance issues, we can add more boringssl fallbacks; the required code is now fairly straightforward. Unlike the old version, this no longer uses NativeAllocationRegistry or similar mechanisms at all. Native memory is only used on a short-term basis, with explicit deallocation. We no longer use boringssl for simple linear-time operations like addition. Microbenchmark results for the newly added benchmark, and for a close-to-final BigInteger version, listed as "combined": Msecs/iteration Digits: 5/10 50/100 500/1000 5000/10000 Inner product, 1000 terms, factors of larger indicated size: current 2.1 2.5 6.4 168 RI 0.11 0.66 11.0 486 combined 0.12 0.67 9.1 189 Harmonic series, uses smaller indicated size current 3.7 3.2 4.3 17.6 RI 0.16 0.34 1.4 14.3 combined 0.17 0.34 1.23 14.2 (1+1/100000)^100000, larger size current 0.07 0.073 0.33 15.8 RI 0.011 0.049 1.553 63.6 combined 0.011 0.049 0.48 13.6 Single modPow() call, smaller size current 0.005 0.011 1.1 583 RI 0.006 0.038 7.2 5580 combined 0.011 0.012 1.1 541 Single modInverse call, larger size current 0.003 0.014 0.375 27.8 RI 0.003 0.003 0.026 1.6 combined 0.002 0.002 0.008 0.4 Bug: 160641142 Bug: 136887041 Bug: 119491938 Bug: 28214673 Bug: 28251030 Bug: 2950143 Test: AOSP Boots. Ran some manual Calculator tests on Cuttlefish. Change-Id: Id577d99328013b1e3c389973dcb0195fa7f52b0b
2019-09-20Remove duplicate libraries that are provided by system modulesPaul Duffin
An improvement in the Soong build means that it is no longer necessary to duplicate the libraries that it provides. This change removes the duplicates and moves the system_modules property next to sdk_version property to be consistent and because those properties are tightly coupled. Bug: 141359858 Test: m checkbuild Change-Id: Ifaa9ece8624e569c522a92d8ed0b5e8b23bb2551
2019-06-12Switch from no_standard_libs:true to sdk_version:"none"Paul Duffin
The no_standard_libs property is deprecated in favor of sdk_version:"none" as the latter is simpler and less error prone. Bug: 134566750 Test: m droid Change-Id: I38166d4d6dfb580a04b794cdb2b910ab221305eb ge-Id: I138061eb330e0bc17f5ae414f1c3df7979472a6a
2019-05-28Fix language level 9 build.Tobias Thierer
Compilation for language level 9 requires java.lang on the module path (~ the bootclasspath) or sourcepath; being on the classpath is not enough. This CL adds core-all-system-modules. Also, for consistency with several other targets (e.g. external/conscrypt's conscrypt-benchmarks) as well as with core-all-system-modules, the benchmarks target is changed to depend on core-all rather than core-oj & core-libart. Note that dependencies on core-all / core-all-system-modules should be kept to a minimum. A future CL might introduce an alternative target to depend on. Fixes: 133764918 Test: EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9=true make benchmarks Change-Id: I5337118c183d6c7a1eab135c122528d4cb0974ef
2019-05-22Convert benchmarks/Android.mk to .bpPaul Duffin
This could not be converted because it built the target into a specific location (/data/caliperperf) that a test depended on and which soong does not support. However, that test appears to be unowned and broken and converting will not make the issue worse. Also, removed the Android.mk file as that was only there to include the benchmarks/Android.mk file. Bug: 130204596 Bug: 122333008 Test: vogar --benchmark --classpath out/target/common/obj/JAVA_LIBRARIES/benchmarks_intermediates/classes.jar benchmarks.AdditionBenchmark Change-Id: I8f4c6963c2f0cab6eb044083f75c887bfc796dfc
2018-10-17Remove benchmarks that use non-public APIsNeil Fuller
These deleted benchmarks: a) Use APIs not in the CorePlatformApi (and not ones we want to add for any other reasons). b) Are built with a .mk file. c) Compile under the javac 8 build (because we reference core-oj/core-libart) but do not compile under the javac 9 build (because AIUI .mk files do not allow us to specify Java 9 system modules). Because we use benchmarks mostly when checking in changes to prove no regression for libcore changes there's no obligation to fix this code: we can delete the troublesome ones. Should somebody need the benchmarks in the future they can deal with migrating the benchmark .mk to a .bp file, etc. Bug: 117871421 Bug: 113148576 Test: make checkbuild (internal with OpenJDK 9 enabled) Change-Id: I391ec9478eba5609021256c1b424e779fe97aa46
2018-10-15Remove non-libcore benchmarksNeil Fuller
Remove benchmarks that use framework APIs or non-public APIs. Also remove explicit dependencies on conscrypt / bouncycastle. Bug: 113148576 Test: make benchmarks Change-Id: Ie7be9a6c76afe09a17c412219c512e194369982d
2018-08-13Merge "Rename org.kxml2 code to com.android.org.kxml2"Treehugger Robot
2018-07-11Rename org.kxml2 code to com.android.org.kxml2Neil Fuller
org.kxml2 code is heavily modified in Android so renaming it to a reserved package name will not make it less maintainable. This rename should also flush out users who are depending on the parser package name. Bug: 111055375 Test: build Change-Id: Idfe871ef7b24fd60d706b932ff2dc52eb9fbf4b6
2018-07-05Merge "Add benchmark for System.getProperty() vs. ↵Tobias Thierer
AccessController/GetPropertyAction." am: f05daa6b1b Change-Id: If3d4667dcb5c00e3b0c5c72ae4aa9ad198fb284c
2018-07-04Add benchmark for System.getProperty() vs. AccessController/GetPropertyAction.Tobias Thierer
Comparing the performance of these options is interesting because libcore carries patches to short-circuit such logic in a few places. This CL came out of a verbal discussion of http://r.android.com/710427 Benchmark results on a 5.5" Google Pixel device from 2016: Using the legacy security code costs approx. 500 nanoseconds per invocation (1136 vs. 1061 ns) when not specifying a default value, or, or 320 nanoseconds (1041 vs. 710 ns) when specifying a default value (1061 vs. 740 ns). Both properties that are accessed (user.language and user.region) have nonempty values on the device that was tested. I ran the benchmark a couple of times; here's the output from one run: Trial Report (1 of 4): Experiment {instrument=runtime, benchmarkMethod=timeAccessController_getPropertyAction, vm=default, parameters={}} Results: runtime(ns): min=1136.75, 1st qu.=1136.75, median=1136.75, mean=1136.75, 3rd qu.=1136.75, max=1136.75 Trial Report (2 of 4): Experiment {instrument=runtime, benchmarkMethod=timeAccessController_getPropertyAction_default, vm=default, parameters={}} Results: runtime(ns): min=1061.38, 1st qu.=1061.38, median=1061.38, mean=1061.38, 3rd qu.=1061.38, max=1061.38 Trial Report (3 of 4): Experiment {instrument=runtime, benchmarkMethod=timeSystem_getProperty, vm=default, parameters={}} Results: runtime(ns): min=634.09, 1st qu.=634.09, median=634.09, mean=634.09, 3rd qu.=634.09, max=634.09 Trial Report (4 of 4): Experiment {instrument=runtime, benchmarkMethod=timeSystem_getProperty_default, vm=default, parameters={}} Results: runtime(ns): min=740.08, 1st qu.=740.08, median=740.08, mean=740.08, 3rd qu.=740.08, max=740.08 Test: vogar --benchmark --verbose benchmarks/GetSystemPropertyBenchmark.java Change-Id: I77461a5007351b144b2dc09ac7c194240332636d
2018-04-24Merge "Verify java.util.Arrays against OpenJDK 8u121-b13." am: 8bef903bf4Pete Gillin
am: 09b6999c5c Change-Id: Ib0631f0b4bd9498940cf52f1c0a1ecc766e3148a
2018-04-24Verify java.util.Arrays against OpenJDK 8u121-b13.Pete Gillin
This change just clarifies some change markers. The change from instanceof to getComponentType() in deepHashCode is kept because it provides a measurable performance increase, see the benchmarks in the comment for http://r.android.com/666141. The change to return early from deepEquals when e2 == null is also kept. Running the same benchmark with a change to include some null elements gives the results shown below. That benchmark change is also included here. With the current code: Trial Report (1 of 10): Experiment {instrument=runtime, benchmarkMethod=deepEquals, vm=default, parameters={arrayLength=0001}} Results: runtime(ns): min=31367.26, 1st qu.=31367.26, median=31367.26, mean=31367.26, 3rd qu.=31367.26, max=31367.26 Trial Report (2 of 10): Experiment {instrument=runtime, benchmarkMethod=deepEquals, vm=default, parameters={arrayLength=0004}} Results: runtime(ns): min=30724.31, 1st qu.=30724.31, median=30724.31, mean=30724.31, 3rd qu.=30724.31, max=30724.31 Trial Report (3 of 10): Experiment {instrument=runtime, benchmarkMethod=deepEquals, vm=default, parameters={arrayLength=0016}} Results: runtime(ns): min=30966.47, 1st qu.=30966.47, median=30966.47, mean=30966.47, 3rd qu.=30966.47, max=30966.47 Trial Report (4 of 10): Experiment {instrument=runtime, benchmarkMethod=deepEquals, vm=default, parameters={arrayLength=0256}} Results: runtime(ns): min=384872.18, 1st qu.=384872.18, median=384872.18, mean=384872.18, 3rd qu.=384872.18, max=384872.18 Trial Report (5 of 10): Experiment {instrument=runtime, benchmarkMethod=deepEquals, vm=default, parameters={arrayLength=2048}} Messages: INFO: This experiment does not require a microbenchmark. The granularity of the timer (1.243us) is less than 0.1% of the measured runtime. If all experiments for this benchmark have runtimes greater than 1.243ms, consider the macrobenchmark instrument. Results: runtime(ns): min=7466868.31, 1st qu.=7466868.31, median=7466868.31, mean=7466868.31, 3rd qu.=7466868.31, max=7466868.31 Trial Report (6 of 10): Experiment {instrument=runtime, benchmarkMethod=deepHashCode, vm=default, parameters={arrayLength=0001}} Results: runtime(ns): min=11564.19, 1st qu.=11564.19, median=11564.19, mean=11564.19, 3rd qu.=11564.19, max=11564.19 Trial Report (7 of 10): Experiment {instrument=runtime, benchmarkMethod=deepHashCode, vm=default, parameters={arrayLength=0004}} Results: runtime(ns): min=11996.46, 1st qu.=11996.46, median=11996.46, mean=11996.46, 3rd qu.=11996.46, max=11996.46 Trial Report (8 of 10): Experiment {instrument=runtime, benchmarkMethod=deepHashCode, vm=default, parameters={arrayLength=0016}} Results: runtime(ns): min=12501.23, 1st qu.=12501.23, median=12501.23, mean=12501.23, 3rd qu.=12501.23, max=12501.23 Trial Report (9 of 10): Experiment {instrument=runtime, benchmarkMethod=deepHashCode, vm=default, parameters={arrayLength=0256}} Results: runtime(ns): min=160199.22, 1st qu.=160199.22, median=160199.22, mean=160199.22, 3rd qu.=160199.22, max=160199.22 Trial Report (10 of 10): Experiment {instrument=runtime, benchmarkMethod=deepHashCode, vm=default, parameters={arrayLength=2048}} Messages: INFO: This experiment does not require a microbenchmark. The granularity of the timer (1.243us) is less than 0.1% of the measured runtime. If all experiments for this benchmark have runtimes greater than 1.243ms, consider the macrobenchmark instrument. Results: runtime(ns): min=3677664.68, 1st qu.=3677664.68, median=3677664.68, mean=3677664.68, 3rd qu.=3677664.68, max=3677664.68 Without the e2 == null change: Trial Report (1 of 10): Experiment {instrument=runtime, benchmarkMethod=deepEquals, vm=default, parameters={arrayLength=0001}} Results: runtime(ns): min=29784.37, 1st qu.=29784.37, median=29784.37, mean=29784.37, 3rd qu.=29784.37, max=29784.37 Trial Report (2 of 10): Experiment {instrument=runtime, benchmarkMethod=deepEquals, vm=default, parameters={arrayLength=0004}} Results: runtime(ns): min=29919.63, 1st qu.=29919.63, median=29919.63, mean=29919.63, 3rd qu.=29919.63, max=29919.63 Trial Report (3 of 10): Experiment {instrument=runtime, benchmarkMethod=deepEquals, vm=default, parameters={arrayLength=0016}} Results: runtime(ns): min=30606.55, 1st qu.=30606.55, median=30606.55, mean=30606.55, 3rd qu.=30606.55, max=30606.55 Trial Report (4 of 10): Experiment {instrument=runtime, benchmarkMethod=deepEquals, vm=default, parameters={arrayLength=0256}} Results: runtime(ns): min=390343.22, 1st qu.=390343.22, median=390343.22, mean=390343.22, 3rd qu.=390343.22, max=390343.22 Trial Report (5 of 10): Experiment {instrument=runtime, benchmarkMethod=deepEquals, vm=default, parameters={arrayLength=2048}} Messages: INFO: This experiment does not require a microbenchmark. The granularity of the timer (1.238us) is less than 0.1% of the measured runtime. If all experiments for this benchmark have runtimes greater than 1.238ms, consider the macrobenchmark instrument. Results: runtime(ns): min=7533281.31, 1st qu.=7533281.31, median=7533281.31, mean=7533281.31, 3rd qu.=7533281.31, max=7533281.31 Trial Report (6 of 10): Experiment {instrument=runtime, benchmarkMethod=deepHashCode, vm=default, parameters={arrayLength=0001}} Results: runtime(ns): min=12169.12, 1st qu.=12169.12, median=12169.12, mean=12169.12, 3rd qu.=12169.12, max=12169.12 Trial Report (7 of 10): Experiment {instrument=runtime, benchmarkMethod=deepHashCode, vm=default, parameters={arrayLength=0004}} Results: runtime(ns): min=12014.69, 1st qu.=12014.69, median=12014.69, mean=12014.69, 3rd qu.=12014.69, max=12014.69 Trial Report (8 of 10): Experiment {instrument=runtime, benchmarkMethod=deepHashCode, vm=default, parameters={arrayLength=0016}} Results: runtime(ns): min=13448.17, 1st qu.=13448.17, median=13448.17, mean=13448.17, 3rd qu.=13448.17, max=13448.17 Trial Report (9 of 10): Experiment {instrument=runtime, benchmarkMethod=deepHashCode, vm=default, parameters={arrayLength=0256}} Results: runtime(ns): min=164844.00, 1st qu.=164844.00, median=164844.00, mean=164844.00, 3rd qu.=164844.00, max=164844.00 Trial Report (10 of 10): Experiment {instrument=runtime, benchmarkMethod=deepHashCode, vm=default, parameters={arrayLength=2048}} Messages: INFO: This experiment does not require a microbenchmark. The granularity of the timer (1.238us) is less than 0.1% of the measured runtime. If all experiments for this benchmark have runtimes greater than 1.238ms, consider the macrobenchmark instrument. Results: runtime(ns): min=3866005.14, 1st qu.=3866005.14, median=3866005.14, mean=3866005.14, 3rd qu.=3866005.14, max=3866005.14 Bug: 35910877 Test: Treehugger Change-Id: Ic611ce1982073113786e840dd6d80c79a48c384f
2018-04-23Merge "Fix DeepArrayOpsBenchmark." am: 1dd66948a4Pete Gillin
am: 80ac91a113 Change-Id: Ide22e6d55ec1f7b4694a04077021c8d00060a497
2018-04-17Fix DeepArrayOpsBenchmark.Pete Gillin
When the caliper version was last updated, the protected void setUp() method stopped getting executed, because it no longer inherited from SimpleBenchmark. That meant that the array and array2 fields never got initialized, so it was benchmarking Arrays.deepHashCode(null) and Arrays.deepEquals(null, null). This change also pads the @Param values with zeros, so that tools which sort alphabetically do the right thing, switches to using the @Benchmark annotation instead of relying on the testFoo method naming convention (to be consistent with using @BeforeExperiment on the setUp method), and removes two unused variables. Test: vogar --benchmark libcore/benchmarks/src/benchmarks/DeepArrayOpsBenchmark.java Bug: 74236526 Change-Id: If3d8037426b7bb6956848e883ffa1dcc9d5eb050
2018-02-16Merge "Remove cachedLocaleData from NumberFormat." am: 6f5d9c76f5 am: 7ee10b4533hansson
am: 85d0d70f9d Change-Id: If56380c0b5ba1cd50da96f1151c09fd25301cfbb
2018-02-16Merge "Remove cachedLocaleData from DecimalFormatSymbols." am: 69844beb4c ↵hansson
am: c9841fd32a am: f8206ba639 Change-Id: I73ea8851116d3a843671df0342e700c5e375b940
2018-02-16Merge "Remove cachedLocaleData from NumberFormat."hansson
2018-02-16Merge "Remove cachedLocaleData from DecimalFormatSymbols."hansson
2018-02-15Remove cachedLocaleData from DecimalFormatSymbols.Anton Hansson
Only takes a ~7 microseconds to reconstruct, and aligns this class closer to upstream. Also dubious if repeatedly reconstructing the same DFS is a use case worth optimizing for. before Experiment {instrument=runtime, benchmarkMethod=time_instantiation, vm=default, parameters={}} Results: runtime(ns): min=16011.69, 1st qu.=16011.69, median=16011.69, mean=16011.69, 3rd qu.=16011.69, max=16011.69 after Experiment {instrument=runtime, benchmarkMethod=time_instantiation, vm=default, parameters={}} Results: runtime(ns): min=23865.50, 1st qu.=23865.50, median=23865.50, mean=23865.50, 3rd qu.=23865.50, max=23865.50 Also see upstream commit http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/rev/1d7a6adf499f. Bug: 31930415 Test: ran CtsLibcoreTests & benchmark Change-Id: I0966125de1690bd0c14f03b190049e7f6948f402
2018-02-15Remove cachedLocaleData from NumberFormat.Anton Hansson
This was removed upstream in this commit: http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/rev/131a683a2ce0 Benchmarking suggests it doesn't make a meaningful difference. Before Experiment {instrument=runtime, benchmarkMethod=time_instantiation, vm=default, parameters={}} Results: runtime(ns): min=191854.43, 1st qu.=191854.43, median=191854.43, mean=191854.43, 3rd qu.=191854.43, max=191854.43 After Experiment {instrument=runtime, benchmarkMethod=time_instantiation, vm=default, parameters={}} Results: runtime(ns): min=192328.06, 1st qu.=192328.06, median=192328.06, mean=192328.06, 3rd qu.=192328.06, max=192328.06 Bug: 31930415 Bug: 35910877 Test: Ran CtsLibcoreTests and the new benchmark Change-Id: I2b272b1ca3a53dd6410ee0d5e9ec672c361fb60c
2018-02-14Merge "Remove cachedLocaleData from DecimalFormat." am: 2ef3444144 am: ↵hansson
67cf38fb29 am: 7103fb15ac Change-Id: Ie6add946a5babf6e298708991ff590f6d4d9fb8b
2018-02-14Remove cachedLocaleData from DecimalFormat.Anton Hansson
This cache was removed upstream in http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/rev/1d7a6adf499f, and doesn't appear to be making a meaningful difference to performance. Benchmark results (product: hikey): Before: Experiment {instrument=runtime, benchmarkMethod=time_instantiation, vm=default, parameters={}} Results: runtime(ns): min=198214.70, 1st qu.=198214.70, median=198214.70, mean=198214.70, 3rd qu.=198214.70, max=198214.70 After: Experiment {instrument=runtime, benchmarkMethod=time_instantiation, vm=default, parameters={}} Results: runtime(ns): min=197940.89, 1st qu.=197940.89, median=197940.89, mean=197940.89, 3rd qu.=197940.89, max=197940.89 Bug: 31930415 Test: m -j droid & ran benchmark Change-Id: I83deaead58b7f79d2016fc68add2ec8b861414c7
2018-01-12Merge changes from topic "utf8decoder" am: 66805fc98d am: 6ded4af9cavichang
am: d50f5e2c1f Change-Id: Ic3813456a964fa7de924c57e66f713439b7ee55a
2018-01-11Make the Android fast-path UTF-8 decoder follow the Unicode Standard and the ↵Victor Chang
W3C Encoding standard. The behavior of UTF-8 decoder in the RI has been made to strictly follow the Unicode standard since OpenJDK 8. JDK-7096080 Essentially, it rejects 1. 3-byte surrogate/6-byte surrogate pair (CESU-8 sequence) 2. treats an ill-formed sequence, e.g. a surrogate, as individual ill-formed bytes. This change updates Android's fast-path UTF-8 decoder to - follow the Unicode standard - have a behavior closer to RI OpenJDK 8 - have consistent behavior between java.nio.charset.CharsetDecoder and fast-path code It implements the W3C recommended UTF-8 decoder. https://www.w3.org/TR/encoding/#utf-8-decoder Behavior change of the fast-path UTF-8 decoder - No longer behaves like a decoder for Modified UTF-8 and CESU-8 sequence -- If an app needs to decode a Modified UTF-8 / CESU-8 sequence, the app can use public API DataInputStream.readUTF or JNI function NewStringUTF See example at StringTest.decodeModifiedUTF8 - Treat overlong sequence as ill-formed. For example, byte sequence "c0 b1" is over-long form of character '1' U+0031. - Treat surrogate (U+D800..U+DFFF) as ill-formed - Maximal subpart should be replaced by a single U+FFFD. For example, in byte sequence "41 C0 AF 41 F4 80 80 41", the maximal subparts are "C0", "AF", and "F4 80 80". "F4 80 80" can be the initial subsequence of "F4 80 80 80", but "C0 AF" can't be the initial subsequence of any well-formed code unit sequence. Thus, the output should be "A\ufffd\ufffdA\ufffdA". Test change: - CharsetEncoder2Test.testUtf8Encoding: UTF-8 encoded Surrogate is treated as invalid - X500PrincipalTest.testValidDN: Overlong sequence is now treated as invalid. According to my test, Android Conscrypt (and BoringSSL) has rejected a certificate with such overlong sequence in CN since OC MR1. Thus, it has little use case to create X500Principal with overlong UTF-8 sequence. Also, RI doesn't pass this test either. Context: From my understanding, certificate and X500 principal are stored in ASN.1 format. The RFC standards quoted in X500Principal don't prohibit overlong UTF-8 sequences. But the new standards RFC5280 for X.509 and RFC3629 for UTF-8 explicitly prohibits any overlong UTF-8 sequences. Performance change: The performance of the fast-path decoder is similar before and after the change. === Before the change === CharsetBenchmark Experiment {instrument=runtime, benchmarkMethod=time_new_String_BString, vm=default, parameters={length=10000, name=UTF-8}} Results: runtime(ns): min=574795.84, 1st qu.=574795.84, median=574795.84, mean=574795.84, 3rd qu.=574795.84, max=574795.84 Trial Report (1 of 4): CharsetUtf8Benchmark Experiment {instrument=runtime, benchmarkMethod=time_ascii, vm=default, parameters={}} Results: runtime(ns): min=58290943.00, 1st qu.=58290943.00, median=58290943.00, mean=58290943.00, 3rd qu.=58290943.00, max=58290943.00 Trial Report (2 of 4): Experiment {instrument=runtime, benchmarkMethod=time_bmp2, vm=default, parameters={}} Results: runtime(ns): min=77581414.00, 1st qu.=77581414.00, median=77581414.00, mean=77581414.00, 3rd qu.=77581414.00, max=77581414.00 Trial Report (3 of 4): Experiment {instrument=runtime, benchmarkMethod=time_bmp3, vm=default, parameters={}} Results: runtime(ns): min=57457297.00, 1st qu.=57457297.00, median=57457297.00, mean=57457297.00, 3rd qu.=57457297.00, max=57457297.00 Trial Report (4 of 4): Experiment {instrument=runtime, benchmarkMethod=time_supplementary, vm=default, parameters={}} Results: runtime(ns): min=60723183.00, 1st qu.=60723183.00, median=60723183.00, mean=60723183.00, 3rd qu.=60723183.00, max=60723183.00 === After the change === CharsetBenchmark Experiment {instrument=runtime, benchmarkMethod=time_new_String_BString, vm=default, parameters={length=10000, name=UTF-8}} Results: runtime(ns): min=523638.25, 1st qu.=523638.25, median=523638.25, mean=523638.25, 3rd qu.=523638.25, max=523638.25 CharsetUtf8Benchmark Trial Report (1 of 4): Experiment {instrument=runtime, benchmarkMethod=time_ascii, vm=default, parameters={}} Results: runtime(ns): min=57101725.00, 1st qu.=57101725.00, median=57101725.00, mean=57101725.00, 3rd qu.=57101725.00, max=57101725.00 Trial Report (2 of 4): Experiment {instrument=runtime, benchmarkMethod=time_bmp2, vm=default, parameters={}} Results: runtime(ns): min=76573080.00, 1st qu.=76573080.00, median=76573080.00, mean=76573080.00, 3rd qu.=76573080.00, max=76573080.00 Trial Report (3 of 4): Experiment {instrument=runtime, benchmarkMethod=time_bmp3, vm=default, parameters={}} Results: runtime(ns): min=59655214.00, 1st qu.=59655214.00, median=59655214.00, mean=59655214.00, 3rd qu.=59655214.00, max=59655214.00 Trial Report (4 of 4): Experiment {instrument=runtime, benchmarkMethod=time_supplementary, vm=default, parameters={}} Results: runtime(ns): min=67283548.00, 1st qu.=67283548.00, median=67283548.00, mean=67283548.00, 3rd qu.=67283548.00, max=67283548.00 Test: cts-tradefed run cts-dev -m CtsLibcoreTestCases Test: cts-tradefed run cts-dev -m CtsLibcoreOjTestCases Bug: 69599767 Bug: 70511691 Change-Id: I2c3e84808b19c969905813f6654ba552b6745354
2017-12-01Merge "Add VMDebug.getInstancesOfClasses API." am: e7aad93b91 am: c3d216eae8Richard Uhler
am: 0ccbbba0de Change-Id: Iae84a56c4425d520bed420901f23fb0a9781caa2
2017-11-30Switch usages of legacy-test to android.test.basePaul Duffin
The legacy-test library has been deprecated in favour of the android.test.base library which is part of the SDK. The following change descriptions were generated automatically and so may be a little repetitive. They are provided to give the reviewer enough information to check the comments match what has actually been changed and check the reasoning behind the changes. * benchmarks/Android.mk Replaced 'legacy-test' with 'android.test.base' in LOCAL_JAVA_LIBRARIES because the source for module 'benchmarks' depends on classes from android.test.base Bug: 30188076 Test: make checkbuild Change-Id: I13e5df50281c4d562deed8605ab594d3af9e0b5d
2017-11-29Add VMDebug.getInstancesOfClasses API.Richard Uhler
The API can be used to iterate over instances of a given type on the heap. The GetInstancesOfClassesBenchmark run on bullhead shows the run time of the API grows linearly in the number of classes, C, to get instances of and the number of total instances, N, allocated on the heap. C N=~2^18 N=~2^19 1 13ms 21ms 2 26ms 43ms 4 53ms 87ms Bug: 69729799 Test: art/test/testrunner/testrunner.py -t 099-vmdebug -b --host Change-Id: Iebc34e1b079e719a66bb93963c5315a0d24834b1
2017-09-27Increase ZipFile read buffers size to 64kPrzemyslaw Szczepaniak
Fixes performance regression introduced in Android N. Increased size of buffer for Inflater in ZipFile.getInputStream from 8k to 64k. Replaced temp stack in bufferZipFile_read with GetByteArrayElements. ZipFileReadBenchmark results on pixel device: Without the change: Experiment {instrument=runtime, benchmarkMethod=timeZipFileRead, vm=default, parameters={readBufferSize=1024}} runtime(ns): min=11591794.71, 1st qu.=11591794.71, median=11591794.71, mean=11591794.71, 3rd qu.=11591794.71, max=11591794.71 Experiment {instrument=runtime, benchmarkMethod=timeZipFileRead, vm=default, parameters={readBufferSize=16384}} runtime(ns): min=4913842.09, 1st qu.=4913842.09, median=4913842.09, mean=4913842.09, 3rd qu.=4913842.09, max=4913842.09 Experiment {instrument=runtime, benchmarkMethod=timeZipFileRead, vm=default, parameters={readBufferSize=65536}} runtime(ns): min=4888673.69, 1st qu.=4888673.69, median=4888673.69, mean=4888673.69, 3rd qu.=4888673.69, max=4888673.69 With the change: Experiment {instrument=runtime, benchmarkMethod=timeZipFileRead, vm=default, parameters={readBufferSize=1024}} runtime(ns): min=11415217.04, 1st qu.=11415217.04, median=11415217.04, mean=11415217.04, 3rd qu.=11415217.04, max=11415217.04 Experiment {instrument=runtime, benchmarkMethod=timeZipFileRead, vm=default, parameters={readBufferSize=16384}} runtime(ns): min=2690763.53, 1st qu.=2690763.53, median=2690763.53, mean=2690763.53, 3rd qu.=2690763.53, max=2690763.53 Experiment {instrument=runtime, benchmarkMethod=timeZipFileRead, vm=default, parameters={readBufferSize=65536}} runtime(ns): min=2202639.03, 1st qu.=2202639.03, median=2202639.03, mean=2202639.03, 3rd qu.=2202639.03, max=2202639.03 Test: vogar run of test in *.java.util.zip packages Bug: 65491407 Change-Id: I7734dde9e6e02b1fbff7209c1256a16ded1654e6
2017-04-04Revert "Revert "Matcher: Avoid excessive String copies.""Narayan Kamath
This reverts commit 53e4e15bb0fc2f789274998f3ce62c4fc021fbe8. Fixes a memory leak introduced in 53e4e15bb0f. Also : - switches to using ScopedStringChars to simplify the code further. - better ICU error checking. Bug: 36366255 Bug: 36818684 Test: cts -m CtsLibcoreTestCases Test: ScannerTest on host/x86 Change-Id: I3f108931cd5236be4ff9c0bd608a87701370dbf1
2017-04-03Revert "Matcher: Avoid excessive String copies."Narayan Kamath
This reverts commit 903563600f39b4efdf22a179f0d270e4d2a72469. Reason for revert: this results in sporadic crashes on host/x86. Change-Id: Ibb914b298df0e814a8684904b118fbaa8b8cab2c bug: 36366255
2017-04-03Matcher: Avoid excessive String copies.Narayan Kamath
We avoid calls to GetStringChars on every JNI call to find or findNext. Given that we now have a moving collector, we always copy on GetStringChars. Moreover, on Android O, we incur the cost of these copies even if the String in question is in a non-moveable space because the String might be compressed. The cost of these calls can quickly add up, especially for the case where the pattern in question occurs several times in the string. Relevant benchmark results are included below. This shows that for a String size of 64kb with near worst case repetition of patterns, the new implementation takes ~1/100th the time (8ms vs 737ms) BEFORE: Experiment {instrument=runtime, benchmarkMethod=timeReplaceAllTrivialPatternSingleOccurence, vm=default, parameters={s=NON_MOVEABLE}} runtime(ns): min=1832194.71, 1st qu.=1865190.38, median=1918799.21, mean=1951987.04, 3rd qu.=2032988.61, max=2171749.44 Experiment {instrument=runtime, benchmarkMethod=timeReplaceTrivialPatternAllRepeated, vm=default, parameters={s=MOVEABLE_256}} runtime(ns): min=91264.94, 1st qu.=91999.01, median=92500.85, mean=92864.29, 3rd qu.=94001.42, max=94304.77 Experiment {instrument=runtime, benchmarkMethod=timeReplaceTrivialPatternAllRepeated, vm=default, parameters={s=MOVEABLE_1024}} runtime(ns): min=460049.96, 1st qu.=464198.96, median=473150.38, mean=477171.31, 3rd qu.=489764.60, max=508391.29 Experiment {instrument=runtime, benchmarkMethod=timeReplaceTrivialPatternAllRepeated, vm=default, parameters={s=NON_MOVEABLE}} runtime(ns): min=736209191.00, 1st qu.=736360924.50, median=737412847.00, mean=737419384.78, 3rd qu.=738278240.00, max=738760545.00 AFTER: Experiment {instrument=runtime, benchmarkMethod=timeReplaceAllTrivialPatternSingleOccurence, vm=default, parameters={s=NON_MOVEABLE}} runtime(ns): min=1518890.99, 1st qu.=1528913.92, median=1637897.87, mean=1626845.46, 3rd qu.=1712046.38, max=1750239.83 Experiment {instrument=runtime, benchmarkMethod=timeReplaceTrivialPatternAllRepeated, vm=default, parameters={s=MOVEABLE_256}} runtime(ns): min=61491.55, 1st qu.=62453.80, median=63083.26, mean=63023.21, 3rd qu.=63730.98, max=64245.10 Experiment {instrument=runtime, benchmarkMethod=timeReplaceTrivialPatternAllRepeated, vm=default, parameters={s=MOVEABLE_1024}} runtime(ns): min=175484.27, 1st qu.=176039.91, median=177751.78, mean=179295.87, 3rd qu.=183334.40, max=187095.50 Experiment {instrument=runtime, benchmarkMethod=timeReplaceTrivialPatternAllRepeated, vm=default, parameters={s=NON_MOVEABLE}} runtime(ns): min=8268762.61, 1st qu.=8396197.28, median=8662951.07, mean=8596467.31, 3rd qu.=8731159.36, max=8973943.49 bug: 36366255 bug: 36818684 Test: cts -m CtsLibcoreTestCases Test: benchmark Change-Id: Iff07cf2c2ebe89f04289bfa92bcd2469fec349e7
2016-11-30Replace core-junit with legacy-testPaul Duffin
m -j32 checkbuild cts droid adb reboot bootloader fastboot flashall -w cts-tradefed run cts -m CtsLibcoreTestCases Bug: 30188076 Test: As above Change-Id: I4147959de045143002d280c9a22539e8c99e0358
2016-10-10Add object clone benchmarkMathieu Chartier
Bug: 32012820 Test: vogar --benchmark libcore/benchmarks/src/benchmarks/CloneBenchmark.java Change-Id: Icc5d4a758cb4f4e1686389bb0cb74ac08e554f04
2016-10-03Remove DateFormat time pattern cachingNeil Fuller
This change removes pattern string caching from the SimpleDateFormat constructor only used by DateFormat.getInstance(). Before this change, the LocaleData.getTimeFormat(int) method that is used to populate the cached data can return different information for SHORT and MEDIUM times based on the DateFormat.is24Hour setting and so the results are not safe to cache: if the user modifies their "use 24-hour format" setting and the data is already cached the old pattern was persisted forever. This was also causing various CTS tests to fail if the device had the "use 24-hour format" setting on. For example: libcore.java.text.OldDateFormatTest org.apache.harmony.tests.java.text.MessageFormatTest org.apache.harmony.tests.java.util.DateTest Callers of java.text.DateFormat.get(int, int, int, Locale) are affected. In practice that means DateFormat.getTimeInstance() / getTimeInstance(int) and getTimeInstance(int, Locale). Indirect callers in the Android framework include: android.text.format.DateUtils android.text.format.DateFormat android.widget.DigitalClock java.text.MessageFormat This change has a small negative affect on performance, but not a significant one: obtaining a DateFormat via DateFormat.getTimeInstance() goes from ~28us to ~33us on an Angler device. Full results for the benchmarks included: Before: benchmarkMethod=timeGetDateTimeInstance runtime(ns): min=27518.68, 1st qu.=28461.12, median=28775.87, mean=28732.44, 3rd qu.=29235.59, max=29320.80 runtime(ns): min=28599.17, 1st qu.=28769.57, median=29277.13, mean=29682.69, 3rd qu.=29824.08, max=33419.06 benchmarkMethod=timeGetDateTimeInstance_multiple runtime(ns): min=108667.38, 1st qu.=110223.70, median=111547.98, mean=112173.89, 3rd qu.=113748.88, max=118091.12 runtime(ns): min=102995.66, 1st qu.=105045.16, median=108558.77, mean=108817.18, 3rd qu.=111677.65, max=115886.11 After: benchmarkMethod=timeGetDateTimeInstance runtime(ns): min=31365.39, 1st qu.=32904.01, median=33303.47, mean=33244.55, 3rd qu.=33983.32, max=34052.99 runtime(ns): min=31785.28, 1st qu.=32921.68, median=33364.01, mean=33531.03, 3rd qu.=34301.06, max=35031.33 benchmarkMethod=timeGetDateTimeInstance_multiple runtime(ns): min=126834.48, 1st qu.=128605.17, median=130069.44, mean=131157.63, 3rd qu.=134095.26, max=138164.92 runtime(ns): min=124618.08, 1st qu.=126097.91, median=130190.93, mean=130027.17, 3rd qu.=131991.56, max=140283.06 Bug: 31762542 Test: Ran CtsLibcoreTestCases with the "use 24-hour format" on and off (cherry picked from commit 6fdc0bf198c455cbe73ecf825bd0f8f985481066) Change-Id: I522782222d4b7f7356b9d26060ce87f3cbf8e674
2016-09-26Revert "Revert "benchmarks: Add timings for @FastNative/@CriticalNative""Igor Murashkin
This reverts commit 29c483ff48aca9e1949e343558522738faec37d6. Change-Id: If76b87b14751ccb2a804182e12ea83efe4a3d00e
2016-09-26Revert "benchmarks: Add timings for @FastNative/@CriticalNative"Nicolas Geoffray
Broke mips build. This reverts commit efab71a017c44850bda9719567683b8c0b3a6f60. Change-Id: Icf06c92e4d0520d28283e899b8988309b15d6ba4
2016-09-23benchmarks: Add timings for @FastNative/@CriticalNativeIgor Murashkin
Bug: 31399521 Bug: 31712552 Test: vogar --benchmark libcore/benchmarks/src/benchmarks/regression/NativeMethodBenchmark.java Change-Id: I704686c97946907b914ad7e44882e4ddbd94a4ff
2016-08-26ART: Added benchmark for string dex cacheChristina Wadsworth
Added a benchmark for the string dex cache, measures how long the fast path takes. In order to account for potential optimizations, I have separated it into two different functions, one of which is called from a loop so the code is no longer in the loop. Please subtract ~1.5ns from the runtime per iteration as a result. Change-Id: I77803ebf83b18b806288349e1e5b3d26ac215d84
2016-08-26Merge "Add an IMT conflict benchmark"Treehugger Robot
2016-08-17Add test and benchmarks for SimpleDateFormat.Joachim Sauer
Add a test that verifies that SimpleDateFormat uses zoneStrings for parsing, when they are provided by the user. This test simply checks existing behaviour in preparation of upcoming changes. The SimpleDateFormatBenchmark has a main() method in addition to the usual caliper tests to allow measuring some first-call times. Otherwise the impact of calling a method on cold caches would be lost in the caliper tests. Test: vogar libcore/luni/src/test/java/libcore/java/text/SimpleDateFormatTest.java Bug: 20879084 Change-Id: I01581a31566df8fa1b60ccce0c8ddecb0230b39e
2016-06-20Add an IMT conflict benchmarkMatthew Gharrity
Measures the performance impact of various conflict depths in IMTs (interface method tables). The benchmark is script-generated since a large number of interface methods are needed in order to produce IMT conflicts. Change-Id: I6d3c7098690c658d33470b891ef69b890e1793a6
2016-06-17More performance benchmarks for MessageDigest.Alex Klyubin
This adds benchmarks for operating on ByteBuffer and benchmarks for larger input chunks, as well as small input chunks contained in a much larger array or ByteBuffer. Bug: 27461702 Change-Id: I61acce1d6a55a822683dc77249e86cabbfd8da9a
2016-05-13JarFile: Optimize getMetaInfEntryNames.Narayan Kamath
Bring back the OpenJDK implementation but make sure that it's case sensitive in its matching. Also update JarFile benchmark to use a different set of JarFiles (ones that actually have resources and are signed). AFTER: Experiment {instrument=runtime, benchmarkMethod=time, vm=default, parameters={filename=/system/framework/core-oj.jar}} runtime(ns): min=89200.91, 1st qu.=92035.88, median=96248.38, mean=95636.11, 3rd qu.=97204.71, max=104263.73 Experiment {instrument=runtime, benchmarkMethod=time, vm=default, parameters={filename=/system/priv-app/Phonesky/Phonesky.apk}} runtime(ns): min=32815012.40, 1st qu.=33074432.68, median=34521206.63, mean=34974008.88, 3rd qu.=36545497.61, max=39179367.36 BEFORE: Experiment {instrument=runtime, benchmarkMethod=time, vm=default, parameters={filename=/system/framework/core-oj.jar}} runtime(ns): min=317222.97, 1st qu.=333416.42, median=339164.45, mean=344867.65, 3rd qu.=352596.11, max=392011.29 Experiment {instrument=runtime, benchmarkMethod=time, vm=default, parameters={filename=/system/priv-app/Phonesky/Phonesky.apk}} runtime(ns): min=36966924.00, 1st qu.=39058659.29, median=43041285.43, mean=42476010.68, 3rd qu.=45566839.83, max=46848927.18 This isn't a perfect benchmark, because a lot of time is spent constructing the JarFile each time. However, we've shaved times by a third for files with a "reasonable" number of entries. bug: 28713954 (cherry picked from commit ff96d13467fa65856c19aaf06b151ce60e0edd8f) Change-Id: I7d26fe9ce17af0f3ed9f8a5aab21dca9c76febb8
2016-04-26Merge "Avoid additional Object allocations that are immediately unboxed"Tobias Thierer
2016-04-25Optimize StringBuilder.append for String with rangeYi Kong
by using String.charsAt to avoid performing 1-by-1 copying. Also adds a benchmark testing append for substring. Before: Trial Report (1 of 3): Experiment {instrument=runtime, benchmarkMethod=timeAppendSubCharSequence, vm=default, parameters={length=1}} Results: runtime(ns): min=231.16, 1st qu.=233.24, median=244.20, mean=241.41, 3rd qu.=247.49, max=252.71 Trial Report (2 of 3): Experiment {instrument=runtime, benchmarkMethod=timeAppendSubCharSequence, vm=default, parameters={length=10}} Results: runtime(ns): min=1639.48, 1st qu.=1646.44, median=1658.96, mean=1669.49, 3rd qu.=1694.87, max=1726.36 Trial Report (3 of 3): Experiment {instrument=runtime, benchmarkMethod=timeAppendSubCharSequence, vm=default, parameters={length=100}} Results: runtime(ns): min=14867.68, 1st qu.=14914.04, median=14965.08, mean=15050.44, 3rd qu.=15189.02, max=15423.22 After: Trial Report (1 of 3): Experiment {instrument=runtime, benchmarkMethod=timeAppendSubCharSequence, vm=default, parameters={length=1}} Results: runtime(ns): min=139.58, 1st qu.=141.36, median=143.44, mean=146.17, 3rd qu.=148.57, max=164.15 Trial Report (2 of 3): Experiment {instrument=runtime, benchmarkMethod=timeAppendSubCharSequence, vm=default, parameters={length=10}} Results: runtime(ns): min=503.95, 1st qu.=507.65, median=520.78, mean=541.48, 3rd qu.=580.13, max=596.60 Trial Report (3 of 3): Experiment {instrument=runtime, benchmarkMethod=timeAppendSubCharSequence, vm=default, parameters={length=100}} Results: runtime(ns): min=4797.27, 1st qu.=4832.23, median=4861.71, mean=4936.96, 3rd qu.=5049.35, max=5140.17 Bug: 28327317 Change-Id: I81a4b83cf4b3d854dbb635cd49669ba0bec96009
2016-04-25Avoid additional Object allocations that are immediately unboxedTobias Thierer
This should catch most of the remaining cases in libcore, although I was more hesitant in tests; for example, TreeMapExtendTest does a lot of unnecessary boxing but the benefit of optimising the test doesn't seem worth the risk of potentially introducing bugs. Bug: 28289401 Change-Id: I911d2b5cf130f974427b4fe7e1916f1632e5f4fa
2016-04-18String: Improve performance of String.getBytes.Narayan Kamath
Add special cases for UTF-8, ISO-8859-1 and US-ASCII. Benchmarks show a 3x to 30x improvement across the board. BEFORE : -------------- Experiment {instrument=runtime, benchmarkMethod=timeGetBytesAscii, vm=default, parameters={string=EMPTY}} runtime(ns): min=3675.38, 1st qu.=3708.42, median=3765.87, mean=3784.90, 3rd qu.=3889.08, max=3897.30 Experiment {instrument=runtime, benchmarkMethod=timeGetBytesAscii, vm=default, parameters={string=L_16}} runtime(ns): min=11766.89, 1st qu.=11804.59, median=12039.35, mean=12016.62, 3rd qu.=12182.33, max=12421.93 Experiment {instrument=runtime, benchmarkMethod=timeGetBytesAscii, vm=default, parameters={string=L_64}} runtime(ns): min=17947.28, 1st qu.=18181.18, median=18474.02, mean=18444.80, 3rd qu.=18733.02, max=18904.24 Experiment {instrument=runtime, benchmarkMethod=timeGetBytesAscii, vm=default, parameters={string=L_256}} runtime(ns): min=54922.50, 1st qu.=55640.28, median=56511.91, mean=56687.14, 3rd qu.=58096.55, max=58555.82 Experiment {instrument=runtime, benchmarkMethod=timeGetBytesAscii, vm=default, parameters={string=L_512}} runtime(ns): min=93966.35, 1st qu.=96132.46, median=96508.71, mean=96668.19, 3rd qu.=97831.84, max=98228.46 Experiment {instrument=runtime, benchmarkMethod=timeGetBytesIso88591, vm=default, parameters={string=EMPTY}} runtime(ns): min=3804.60, 1st qu.=3832.21, median=3870.29, mean=3955.06, 3rd qu.=3998.85, max=4513.34 Experiment {instrument=runtime, benchmarkMethod=timeGetBytesIso88591, vm=default, parameters={string=L_16}} runtime(ns): min=12325.98, 1st qu.=12489.95, median=12592.85, mean=12617.96, 3rd qu.=12760.47, max=13013.03 Experiment {instrument=runtime, benchmarkMethod=timeGetBytesIso88591, vm=default, parameters={string=L_64}} runtime(ns): min=18154.88, 1st qu.=18353.76, median=18518.34, mean=18540.77, 3rd qu.=18748.34, max=18811.98 Experiment {instrument=runtime, benchmarkMethod=timeGetBytesIso88591, vm=default, parameters={string=L_256}} runtime(ns): min=41027.14, 1st qu.=41446.54, median=41877.28, mean=41905.38, 3rd qu.=42363.32, max=42933.43 Experiment {instrument=runtime, benchmarkMethod=timeGetBytesIso88591, vm=default, parameters={string=L_512}} runtime(ns): min=91035.64, 1st qu.=92336.02, median=94013.21, mean=93905.50, 3rd qu.=95455.29, max=96344.39 Experiment {instrument=runtime, benchmarkMethod=timeGetBytesUtf8, vm=default, parameters={string=EMPTY}} runtime(ns): min=3781.58, 1st qu.=3795.26, median=3839.86, mean=3845.25, 3rd qu.=3866.07, max=3969.57 Experiment {instrument=runtime, benchmarkMethod=timeGetBytesUtf8, vm=default, parameters={string=L_16}} runtime(ns): min=12044.17, 1st qu.=12090.35, median=12179.87, mean=12195.30, 3rd qu.=12298.93, max=12376.89 Experiment {instrument=runtime, benchmarkMethod=timeGetBytesUtf8, vm=default, parameters={string=L_64}} runtime(ns): min=18972.04, 1st qu.=19136.75, median=19347.64, mean=19409.64, 3rd qu.=19709.62, max=19952.67 Experiment {instrument=runtime, benchmarkMethod=timeGetBytesUtf8, vm=default, parameters={string=L_256}} runtime(ns): min=47600.52, 1st qu.=48461.23, median=50291.26, mean=50161.80, 3rd qu.=51811.29, max=52993.30 Experiment {instrument=runtime, benchmarkMethod=timeGetBytesUtf8, vm=default, parameters={string=L_512}} runtime(ns): min=75600.36, 1st qu.=75968.53, median=78173.55, mean=78727.87, 3rd qu.=81136.79, max=84758.54 AFTER : ------------ Experiment {instrument=runtime, benchmarkMethod=timeGetBytesAscii, vm=default, parameters={string=EMPTY}} runtime(ns): min=1104.34, 1st qu.=1131.09, median=1150.68, mean=1154.42, 3rd qu.=1168.01, max=1243.59 Experiment {instrument=runtime, benchmarkMethod=timeGetBytesAscii, vm=default, parameters={string=L_16}} runtime(ns): min=1137.97, 1st qu.=1151.18, median=1177.42, mean=1172.80, 3rd qu.=1195.89, max=1199.96 Experiment {instrument=runtime, benchmarkMethod=timeGetBytesAscii, vm=default, parameters={string=L_64}} runtime(ns): min=1522.89, 1st qu.=1544.52, median=1571.69, mean=1612.86, 3rd qu.=1690.00, max=1708.94 Experiment {instrument=runtime, benchmarkMethod=timeGetBytesAscii, vm=default, parameters={string=L_256}} runtime(ns): min=2458.72, 1st qu.=2559.36, median=3023.47, mean=2962.93, 3rd qu.=3282.42, max=3426.12 Experiment {instrument=runtime, benchmarkMethod=timeGetBytesAscii, vm=default, parameters={string=L_512}} runtime(ns): min=3785.74, 1st qu.=3874.94, median=4552.37, mean=4681.23, 3rd qu.=5574.72, max=6245.85 Experiment {instrument=runtime, benchmarkMethod=timeGetBytesIso88591, vm=default, parameters={string=EMPTY}} runtime(ns): min=1137.79, 1st qu.=1149.34, median=1171.17, mean=1166.55, 3rd qu.=1180.61, max=1194.83 Experiment {instrument=runtime, benchmarkMethod=timeGetBytesIso88591, vm=default, parameters={string=L_16}} runtime(ns): min=1049.41, 1st qu.=1086.79, median=1134.18, mean=1146.32, 3rd qu.=1172.61, max=1357.04 Experiment {instrument=runtime, benchmarkMethod=timeGetBytesIso88591, vm=default, parameters={string=L_64}} runtime(ns): min=1193.05, 1st qu.=1451.91, median=1542.92, mean=1527.42, 3rd qu.=1643.31, max=1695.34 Experiment {instrument=runtime, benchmarkMethod=timeGetBytesIso88591, vm=default, parameters={string=L_256}} runtime(ns): min=2515.17, 1st qu.=2940.09, median=3143.91, mean=3114.54, 3rd qu.=3321.73, max=3444.45 Experiment {instrument=runtime, benchmarkMethod=timeGetBytesIso88591, vm=default, parameters={string=L_512}} runtime(ns): min=3881.31, 1st qu.=3970.16, median=4328.92, mean=4291.21, 3rd qu.=4582.91, max=4885.02 Experiment {instrument=runtime, benchmarkMethod=timeGetBytesUtf8, vm=default, parameters={string=EMPTY}} runtime(ns): min=955.51, 1st qu.=972.96, median=979.11, mean=977.32, 3rd qu.=983.49, max=988.33 Experiment {instrument=runtime, benchmarkMethod=timeGetBytesUtf8, vm=default, parameters={string=L_16}} runtime(ns): min=1229.63, 1st qu.=1242.28, median=1251.33, mean=1254.39, 3rd qu.=1268.16, max=1272.79 Experiment {instrument=runtime, benchmarkMethod=timeGetBytesUtf8, vm=default, parameters={string=L_64}} runtime(ns): min=1768.46, 1st qu.=1816.73, median=1854.81, mean=1883.12, 3rd qu.=1975.01, max=1996.59 Experiment {instrument=runtime, benchmarkMethod=timeGetBytesUtf8, vm=default, parameters={string=L_256}} runtime(ns): min=8710.40, 1st qu.=9348.30, median=9750.93, mean=9935.78, 3rd qu.=10569.36, max=11556.14 Experiment {instrument=runtime, benchmarkMethod=timeGetBytesUtf8, vm=default, parameters={string=L_512}} runtime(ns): min=14126.17, 1st qu.=14228.94, median=15590.25, mean=15130.62, 3rd qu.=15826.37, max=15944.59 bug: 28189091 Change-Id: Ic477f917f07d61c9524cb8b572a50f00a2a2ae63
2016-04-08benchmarks: Add a String benchmark for replace.Narayan Kamath
Benchmarks have been added for the single char replacements as well as Charsequence replacements. bug: 28060800 Change-Id: Ib0fc466b38ff2037a422d5197694605f371a6959
2016-04-07Add Character#digit(int, int) fastpathPrzemyslaw Szczepaniak
Added a java fastpath for common cases in the Character#digit(int, int) method. Improves performance of conversions from string to numeric types. Bug: 28008616 Change-Id: I28aacba520c3f51a5cb5a59e51d4ae593daa551c (cherry picked from commit cff29861633f2d4907b79644dace4a6790982faf)