You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "deven you (JIRA)" <ji...@apache.org> on 2009/02/18 06:33:01 UTC

[jira] Created: (HARMONY-6095) [classlib][luni] Performance improvement patch for java.text.DateFormatSymbols.DateFormatSymbols(Locale)

[classlib][luni] Performance improvement patch for java.text.DateFormatSymbols.DateFormatSymbols(Locale)
--------------------------------------------------------------------------------------------------------

                 Key: HARMONY-6095
                 URL: https://issues.apache.org/jira/browse/HARMONY-6095
             Project: Harmony
          Issue Type: Improvement
          Components: Classlib
    Affects Versions: 5.0M8
            Reporter: deven you
         Attachments: hy-text.diff

this constructor spend much time on getZoneString(), howerver it is rarely used in real world application. so I just delay loading the ZoneStrings 
the testcase is :

import java.text.DateFormatSymbols;
import java.util.Locale;

public class TestDateFormatSymbols {
    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 test on 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-6095) [classlib][luni] Performance improvement patch for java.text.DateFormatSymbols.DateFormatSymbols(Locale)

Posted by "deven you (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6095?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

deven you updated HARMONY-6095:
-------------------------------

    Attachment: DateFormatSymbolsTest.diff

I have create the testcase patch, thanks a lot!

> [classlib][luni] Performance improvement patch for java.text.DateFormatSymbols.DateFormatSymbols(Locale)
> --------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6095
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6095
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: deven you
>            Assignee: Tony Wu
>         Attachments: DateFormatSymbolsTest.diff, hy-text.diff, hy-text_v2.diff
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> this constructor spend much time on getZoneString(), howerver it is rarely used in real world application. so I just delay loading the ZoneStrings 
> the testcase is :
> import java.text.DateFormatSymbols;
> import java.util.Locale;
> public class TestDateFormatSymbols {
>     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 test on 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6095) [classlib][luni] Performance improvement patch for java.text.DateFormatSymbols.DateFormatSymbols(Locale)

Posted by "Tony Wu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12676549#action_12676549 ] 

Tony Wu commented on HARMONY-6095:
----------------------------------

Hi Deven

Can you integrate your testcases to your patch as well so that it could be granted the permission to apache.
It is suggeted to write in the same pattern as our existing serialization tests, you can refer to DecimalFormatSymbolsTest or others.


> [classlib][luni] Performance improvement patch for java.text.DateFormatSymbols.DateFormatSymbols(Locale)
> --------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6095
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6095
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: deven you
>            Assignee: Tony Wu
>         Attachments: hy-text.diff, hy-text_v2.diff
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> this constructor spend much time on getZoneString(), howerver it is rarely used in real world application. so I just delay loading the ZoneStrings 
> the testcase is :
> import java.text.DateFormatSymbols;
> import java.util.Locale;
> public class TestDateFormatSymbols {
>     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 test on 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6095) [classlib][luni] Performance improvement patch for java.text.DateFormatSymbols.DateFormatSymbols(Locale)

Posted by "Regis Xu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12719425#action_12719425 ] 

Regis Xu commented on HARMONY-6095:
-----------------------------------

Hi Deven,

I tried to apply patch hy-text_v2.diff but failed:
$ patch -p0 <  /home/bahamut/download/hy-text_v2.diff 
patching file modules/text/src/main/java/java/text/DateFormatSymbols.java
Hunk #2 succeeded at 70 with fuzz 2 (offset 33 lines).
Hunk #3 succeeded at 88 with fuzz 1 (offset 33 lines).
patch: **** malformed patch at line 50: @@ -73,6 +83,9 @@

Would you please take look at this?

> [classlib][luni] Performance improvement patch for java.text.DateFormatSymbols.DateFormatSymbols(Locale)
> --------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6095
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6095
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: deven you
>            Assignee: Tony Wu
>         Attachments: DateFormatSymbolsTest.diff, hy-text.diff, hy-text_v2.diff
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> this constructor spend much time on getZoneString(), howerver it is rarely used in real world application. so I just delay loading the ZoneStrings 
> the testcase is :
> import java.text.DateFormatSymbols;
> import java.util.Locale;
> public class TestDateFormatSymbols {
>     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 test on 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HARMONY-6095) [classlib][luni] Performance improvement patch for java.text.DateFormatSymbols.DateFormatSymbols(Locale)

Posted by "Regis Xu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6095?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Regis Xu resolved HARMONY-6095.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 5.0M11

Thanks Deven.

Patch applied at r784683, please verify it was applied as you expected.

> [classlib][luni] Performance improvement patch for java.text.DateFormatSymbols.DateFormatSymbols(Locale)
> --------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6095
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6095
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: deven you
>            Assignee: Regis Xu
>             Fix For: 5.0M11
>
>         Attachments: DateFormatSymbolsTest.diff, hy-text.diff, hy-text_v2.diff, hy-text_v4.diff
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> this constructor spend much time on getZoneString(), howerver it is rarely used in real world application. so I just delay loading the ZoneStrings 
> the testcase is :
> import java.text.DateFormatSymbols;
> import java.util.Locale;
> public class TestDateFormatSymbols {
>     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 test on 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (HARMONY-6095) [classlib][luni] Performance improvement patch for java.text.DateFormatSymbols.DateFormatSymbols(Locale)

Posted by "Regis Xu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6095?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Regis Xu reassigned HARMONY-6095:
---------------------------------

    Assignee: Regis Xu  (was: Tony Wu)

> [classlib][luni] Performance improvement patch for java.text.DateFormatSymbols.DateFormatSymbols(Locale)
> --------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6095
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6095
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: deven you
>            Assignee: Regis Xu
>         Attachments: DateFormatSymbolsTest.diff, hy-text.diff, hy-text_v2.diff, hy-text_v4.diff
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> this constructor spend much time on getZoneString(), howerver it is rarely used in real world application. so I just delay loading the ZoneStrings 
> the testcase is :
> import java.text.DateFormatSymbols;
> import java.util.Locale;
> public class TestDateFormatSymbols {
>     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 test on 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-6095) [classlib][luni] Performance improvement patch for java.text.DateFormatSymbols.DateFormatSymbols(Locale)

Posted by "deven you (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6095?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

deven you updated HARMONY-6095:
-------------------------------

    Attachment: hy-text_v4.diff

Hi Regis, pleas try this one. thanks

> [classlib][luni] Performance improvement patch for java.text.DateFormatSymbols.DateFormatSymbols(Locale)
> --------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6095
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6095
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: deven you
>            Assignee: Tony Wu
>         Attachments: DateFormatSymbolsTest.diff, hy-text.diff, hy-text_v2.diff, hy-text_v4.diff
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> this constructor spend much time on getZoneString(), howerver it is rarely used in real world application. so I just delay loading the ZoneStrings 
> the testcase is :
> import java.text.DateFormatSymbols;
> import java.util.Locale;
> public class TestDateFormatSymbols {
>     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 test on 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-6095) [classlib][luni] Performance improvement patch for java.text.DateFormatSymbols.DateFormatSymbols(Locale)

Posted by "deven you (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6095?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

deven you updated HARMONY-6095:
-------------------------------

    Attachment: hy-text_v2.diff

I have updated the patch so that DateFormatSymbols now can follow the compatibility. there is a testcase for testing its serialization:

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.text.DateFormatSymbols;
import java.util.Arrays;

import junit.framework.TestCase;

public class TestDfs extends TestCase {

    private ByteArrayOutputStream bao;

    private ObjectOutputStream oos;

    private ObjectInputStream ois;

    public TestDfs(String name) {
        super(name);
    }

    protected void setUp() throws Exception {
        super.setUp();
    }

    protected void tearDown() throws Exception {
        super.tearDown();
    }

    public void test_Serialization_DateFormatSymbols() throws IOException,
            ClassNotFoundException {
        DateFormatSymbols dfs = new DateFormatSymbols();
        String[][] zoneStrings = dfs.getZoneStrings();
        oos = new ObjectOutputStream(bao = new ByteArrayOutputStream());
        oos.writeObject(dfs);
        ois = new ObjectInputStream(new ByteArrayInputStream(bao.toByteArray()));
        DateFormatSymbols result = (DateFormatSymbols) ois.readObject();
        boolean isEqual = true;
        String[][] rsZoneStrings = result.getZoneStrings();
        if (zoneStrings.length != rsZoneStrings.length) {
            isEqual = false;
           assertTrue("zoneStrings and rsZoneStrings is equal", isEqual);
           return;
        } 
        for (int i = 0; i < zoneStrings.length; i++) {
            if (!Arrays.equals(zoneStrings[i], rsZoneStrings[i])) {
                isEqual = false;
            }
        }
        assertTrue("zoneStrings and rsZoneStrings is equal", isEqual);

    }
}

> [classlib][luni] Performance improvement patch for java.text.DateFormatSymbols.DateFormatSymbols(Locale)
> --------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6095
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6095
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: deven you
>         Attachments: hy-text.diff, hy-text_v2.diff
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> this constructor spend much time on getZoneString(), howerver it is rarely used in real world application. so I just delay loading the ZoneStrings 
> the testcase is :
> import java.text.DateFormatSymbols;
> import java.util.Locale;
> public class TestDateFormatSymbols {
>     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 test on 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (HARMONY-6095) [classlib][luni] Performance improvement patch for java.text.DateFormatSymbols.DateFormatSymbols(Locale)

Posted by "Regis Xu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6095?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Regis Xu closed HARMONY-6095.
-----------------------------


no response, assume OK.

> [classlib][luni] Performance improvement patch for java.text.DateFormatSymbols.DateFormatSymbols(Locale)
> --------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6095
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6095
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: deven you
>            Assignee: Regis Xu
>             Fix For: 5.0M11
>
>         Attachments: DateFormatSymbolsTest.diff, hy-text.diff, hy-text_v2.diff, hy-text_v4.diff
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> this constructor spend much time on getZoneString(), howerver it is rarely used in real world application. so I just delay loading the ZoneStrings 
> the testcase is :
> import java.text.DateFormatSymbols;
> import java.util.Locale;
> public class TestDateFormatSymbols {
>     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 test on 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (HARMONY-6095) [classlib][luni] Performance improvement patch for java.text.DateFormatSymbols.DateFormatSymbols(Locale)

Posted by "Tony Wu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6095?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tony Wu reassigned HARMONY-6095:
--------------------------------

    Assignee: Tony Wu

> [classlib][luni] Performance improvement patch for java.text.DateFormatSymbols.DateFormatSymbols(Locale)
> --------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6095
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6095
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: deven you
>            Assignee: Tony Wu
>         Attachments: hy-text.diff, hy-text_v2.diff
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> this constructor spend much time on getZoneString(), howerver it is rarely used in real world application. so I just delay loading the ZoneStrings 
> the testcase is :
> import java.text.DateFormatSymbols;
> import java.util.Locale;
> public class TestDateFormatSymbols {
>     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 test on 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-6095) [classlib][luni] Performance improvement patch for java.text.DateFormatSymbols.DateFormatSymbols(Locale)

Posted by "deven you (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6095?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

deven you updated HARMONY-6095:
-------------------------------

    Attachment: hy-text.diff

> [classlib][luni] Performance improvement patch for java.text.DateFormatSymbols.DateFormatSymbols(Locale)
> --------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6095
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6095
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: deven you
>         Attachments: hy-text.diff
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> this constructor spend much time on getZoneString(), howerver it is rarely used in real world application. so I just delay loading the ZoneStrings 
> the testcase is :
> import java.text.DateFormatSymbols;
> import java.util.Locale;
> public class TestDateFormatSymbols {
>     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 test on 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.