OSDN Git Service

Speed up DecimalFormatSymbols.
authorElliott Hughes <enh@google.com>
Mon, 4 Jan 2010 23:23:25 +0000 (15:23 -0800)
committerElliott Hughes <enh@google.com>
Tue, 5 Jan 2010 00:20:43 +0000 (16:20 -0800)
commit32881d70f0df98abf9ce9a2a6a7a69ab3e069d26
treedfa39e78358c1377ef09be5cf2cfa244657834d5
parentcfb66e820d16c319e6c19369a345adc4da31c9d3
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.
libcore/icu/src/main/java/com/ibm/icu4jni/text/DecimalFormatSymbols.java
libcore/icu/src/main/java/com/ibm/icu4jni/text/NativeDecimalFormat.java
libcore/icu/src/main/native/DecimalFormatInterface.cpp
libcore/text/src/main/java/java/text/DecimalFormat.java