harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Yu <junjie0...@gmail.com>
Subject Re: [classlib][luni] Performance improvement patch for java.text.DateFormatSymbols.DateFormatSymbols(Locale)
Date Wed, 18 Feb 2009 06:12:08 GMT
Hi Deven,
Thanks for your contribution. The lazy loading mechanism sounds reasonable
to me: )
Have you run any benchmarks to verify the performance gain? If the patch
does have impact
on them, it will be more persuadable.

2009/2/18 Deven You <devyoudw@gmail.com>

> Hi,
> I have raised a jira HARMONY-6095 for improving java.text.DateFormatSymbols
> performance. I found  DateFormatSymbols(Locale) will invoke
> com.ibm.icu.text.DateFormatSymbols.getZoneStrings() which can take
> significant time but rarely used in real world applications. So I delay
> this
> call until it really be used. it seems the performance of
> DateFormatSymbols(Locale)  can be greatly improved.*
> *the testcase is:
>
> import java.text.DateFormatSymbols;
> import java.util.Locale;
>
> public class TestDateFormatSymbols {
>
>    /**
>     * @param args
>     */
>    public static void main(String[] args) {
>        long time = System.currentTimeMillis();
>        DateFormatSymbols dfs = new DateFormatSymbols(Locale.getDefault());
>        time = System.currentTimeMillis() - time;
>
>        System.out.println("the total time is " + time + " ms!");
>    }
>
> }
>
> I have tested  on Intel(R) Core(TM)2 Duo Cpu 2.4GHZ, 2.98GB Memory machine,
> the result is as below:
> Harmony patch before: 1125 ms
>  Harmony patched: 78 ms
>



-- 
Best Regards,
Jim, Jun Jie Yu

China Software Development Lab, IBM

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message