History log of /dalvik/libcore/icu/src/main/java/com/ibm/icu4jni/text/NativeDecimalFormat.java
Revision Date Author Comments
b7df12f1bb73889f354806213b218a3a7d986448 29-Jan-2010 Elliott Hughes <enh@google.com> Use DecimalFormatSymbols' new default constructor for speed.

This brings "new DecimalFormat" down to ~80us (from ~260us before this patch,
or ~600us this time last week). Also remove some dead code and tighten up some
accessibility.

Depends on https://android-git.corp.google.com/g/38877.
61da38c3b2bd80b1863a3788b1a7ffdd730fd70f 28-Jan-2010 Elliott Hughes <enh@google.com> Double the speed of DecimalFormat creation.

Our calls to unum_setSymbol were making us O(n^2); switching to the C++ API
and doing a bulk update is a huge win. (ICU is really a C++ library with a
C wrapper. It's always going to be slightly wasteful to go via C, but here
it's especially harmful.)

The new ScopedJavaUnicodeString provides a best-of-breed bridge between Java
strings on the Java heap and the UnicodeString type that ICU wants. I'll come
back and switch more of our ICU JNI over in a later patch.
ef05746e0c699a79ff2084861c346c09f1208b75 28-Jan-2010 Elliott Hughes <enh@google.com> Remove commented-out code.

Mistakenly left in my previous change when I wasn't certain it was dead.
fc7f3e4e4e169f08577a37fbe02cc2a80fba77d2 28-Jan-2010 Elliott Hughes <enh@google.com> Fix NumberFormat's behavior with BigInteger and custom Number subclasses.

Also remove a few bits of cruft I ran across, and stop duplicating the
documentation between NumberFormat and DecimalFormat.

Bug: 2387934
536a964538d43749cfb88b3023bc4f8c31588b9a 27-Jan-2010 Elliott Hughes <enh@google.com> Rename icu4jni's DecimalFormat to NativeDecimalFormat, to reduce confusion.
17c4196ef6904c7770455ff68f3b54e3dfbc6ad7 27-Jan-2010 Elliott Hughes <enh@google.com> Gut NativeDecimalFormat in favor of icu4jni.DecimalFormat.

(I'll come back and rename icu4jni.DecimalFormat to NativeDecimalFormat and
remove all the fully-qualified names that distinguish between java.text's
DecimalFormat and icu4jni's DecimalFormat.)
eb5822b70b3e578dbe692a60b8a93b90a9d4df93 26-Jan-2010 Elliott Hughes <enh@google.com> Simplify our DecimalFormat.

Both the is-a and has-a hierarchies for our DecimalFormat implementation were
over-complicated. This patch starts to address that, and makes cloning twice
as fast (50us versus 100us), but not as fast as I'd like (<10us), and without
making much of a dent in the time it takes to create a new NumberFormat (550us
versus 600us).

The speed of cloning is important because Formatter has a hack that uses it,
and I want to change NumberFormat so that it always hands out clones... at
least until I have time to make "new NumberFormat" acceptably fast.

Also fixes DecimalFormat.applyLocalizedPattern (which used to behave as if
you'd called applyPattern).
c9bb8b9827b5731d51fb9d99695256a17359af3f 05-Jan-2010 Elliott Hughes <enh@google.com> Last bunch of NumberFormat speedups.

Don't mess around with setCurrency in DecimalFormat.copySymbols when we're
going to override any effect that call will have had in the next few lines:
we always call setCurrencySymbol and setInternationalCurrencySymbol, so
setCurrency is just wasting time.

Replaces the NativeDecimalFormat.UNumberFormatSymbol enum -- which was only used
for getting ints to pass to native code, using Enum.ordinal -- with ints.

Adds a constructor to the java.text DecimalFormat so we can avoid cloning the
DecimalFormatSymbols object we create for its private use.

This is another 10% shaved off.

I've also removed an unused local from the icu4jni DecimalFormat, so I can
remove a then-unused getLocale method from the ICU DecimalFormatSymbols.

I've rewritten the icu4jni DecimalFormatSymbols.clone to remove the scary
constructor that took an arbitrary int and treated it as a uintptr_t when
talking to native code.
32881d70f0df98abf9ce9a2a6a7a69ab3e069d26 05-Jan-2010 Elliott Hughes <enh@google.com> Speed up DecimalFormatSymbols.

We don't need to create temporary String objects; we can just pass a char
directly. We also don't need to initialize aspects of our native peer if
we know we're going to overwrite them straight away, and making copying
into ICU the responsibility of the icu4jni class rather than the java.text
is slightly cleaner.

Together, these changes make creating a new NumberFormat about 20% faster.
f6c387128427e121477c1b32ad35cdcaa5101ba3 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
f72d5de56a522ac3be03873bdde26f23a5eeeb3c 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
89c1feb0a69a7707b271086e749975b3f7acacf7 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
2ad60cfc28e14ee8f0bb038720836a4696c478ad 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution