History log of /libcore/benchmarks/src/benchmarks/regression/DecimalFormatBenchmark.java
Revision Date Author Comments
ea13f8291a92b6f47f50011da1d5e8c107984bc3 30-Nov-2015 Paul Duffin <paulduffin@google.com> Switch to latest version of Caliper

Convert the benchmarks to the latest version of Caliper.

Bug: 24848946
Change-Id: Iac04b30dac61ccb397a6685890da64bae4d3b318
34ba8b516b5fd28fbf6a8608be6a7596716a8166 17-Jul-2015 Rayhaan Jaufeerally <rayhaan@google.com> Migrate DecimalFormat to use ICU4J.

This change migrates the underlying implementation of
DecimalFormat to use the Java version of the ICU library.

All all issues related to Harmony test failures have been
tracked down and everything not yet fixed in ICU has a
draft fix in the following commits:

https://android.googlesource.com/platform/external/icu/+/7a53939fbc0103d77d09d0174c52df850363caff
https://android.googlesource.com/platform/external/icu/+/90d4668d4d710507b3302de044e3a398cc4fe5ba
https://android.googlesource.com/platform/external/icu/+/4de0761d798b9a92826397e603835c742c8ff873

Behaviour change: Now a new instance of DecimalFormat()
has 309 as the maximumIntegerDigits instead of 20000000
which it was before. This is because it doesn't make
sense to have this value when ICU will only use up to 309
to format numbers.

Furthermore, ICU4J now returns patterns in the form of
<positive-part>;<negative-part> for displaying the
difference between positive and negative number formats.
Tests have been adjusted accordingly.

Benchmarks:
benchmark JAVA NATIVE
_formatAsExponent10e100 96 40
_formatAsExponent10e1000 13 34
_formatAsExponent10e3 37 33
_formatAsExponent10e9 38 33
_formatBigDecimal10e100 99 64
_formatBigDecimal10e1000 306 249
_formatBigDecimal10e3 34 29
_formatBigDecimal10e9 39 33
_formatE 18 39
_formatEur 7 22
_formatEurWithCents 14 37
_formatGrouping_BigDecimal10e100 104 63
_formatGrouping_BigDecimal10e1000 307 249
_formatGrouping_BigDecimal10e3 34 29
_formatGrouping_BigDecimal10e9 35 34
_formatPi 18 39
_formatToCharacterIterator10e100 3231 148
_formatToCharacterIterator10e1000 90411 4789
_formatToCharacterIterator10e3 163 34
_formatToCharacterIterator10e9 318 44
_formatUSD 8 31
_formatUsdWithCents 14 38

Tested on Nexus 5, times in us.

Change-Id: I642fd02acd3bcd198960cdf2a8d973db7baec42b