You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Andrew Cornwall (JIRA)" <ji...@apache.org> on 2008/06/23 23:59:45 UTC

[jira] Created: (HARMONY-5882) [classlib][pack200] Performance improvements for pack200

[classlib][pack200] Performance improvements for pack200
--------------------------------------------------------

                 Key: HARMONY-5882
                 URL: https://issues.apache.org/jira/browse/HARMONY-5882
             Project: Harmony
          Issue Type: Improvement
          Components: Classlib
    Affects Versions: 5.0M6
         Environment: Pack200 HEAD
            Reporter: Andrew Cornwall
         Attachments: main.patch, test.patch

Attached are some performance improvements for Pack200. They do two things:
 1. Remove unnecessary conversions to UTF-8 in CPUTF8
 2. Cache array lookup in SegmentConstantPool

Hope they work - this is my first try at applying a fix since I've forked.

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


[jira] Commented: (HARMONY-5882) [classlib][pack200] Performance improvements for pack200

Posted by "Sian January (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12608408#action_12608408 ] 

Sian January commented on HARMONY-5882:
---------------------------------------

Sorry - I'm getting confused.  There wasn't a public field at all.  

I think the discussion about tests and private vs. public methods is more of a general discussion that we should move to the dev list.  We have a lot of public methods in pack200 that could be made package-private by the same reasoning if we moved the tests, so unless there are any objections I'm going to apply the patch for this JIRA and we can discuss the general issue on the list.

> [classlib][pack200] Performance improvements for pack200
> --------------------------------------------------------
>
>                 Key: HARMONY-5882
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5882
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M6
>         Environment: Pack200 HEAD
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>         Attachments: Lexer.class, main.updated.patch, test.updated.patch
>
>
> Attached are some performance improvements for Pack200. They do two things:
>  1. Remove unnecessary conversions to UTF-8 in CPUTF8
>  2. Cache array lookup in SegmentConstantPool
> Hope they work - this is my first try at applying a fix since I've forked.

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


[jira] Updated: (HARMONY-5882) [classlib][pack200] Performance improvements for pack200

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

Andrew Cornwall updated HARMONY-5882:
-------------------------------------

    Attachment: test.patch
                main.patch

main.patch is source code for speed improvements. test.patch includes test cases to verify they work.

> [classlib][pack200] Performance improvements for pack200
> --------------------------------------------------------
>
>                 Key: HARMONY-5882
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5882
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M6
>         Environment: Pack200 HEAD
>            Reporter: Andrew Cornwall
>         Attachments: main.patch, test.patch
>
>
> Attached are some performance improvements for Pack200. They do two things:
>  1. Remove unnecessary conversions to UTF-8 in CPUTF8
>  2. Cache array lookup in SegmentConstantPool
> Hope they work - this is my first try at applying a fix since I've forked.

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


[jira] Commented: (HARMONY-5882) [classlib][pack200] Performance improvements for pack200

Posted by "Sian January (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12607621#action_12607621 ] 

Sian January commented on HARMONY-5882:
---------------------------------------

Andrew - I'm getting a problem with this patch running some of my longer-running tests that aren't in the repository.  One of these tests runs javap against every class in the Harmony swing module (unpacked with our version of unpack200) and I'm seeing the following problem with javax.swing.text.html.parser.Lexer:

java.io.UTFDataFormatException: malformed input around byte 15
        at java.io.DataInputStream.readUTF(DataInputStream.java:612)
        at java.io.DataInputStream.readUTF(DataInputStream.java:522)
        at sun.tools.javap.ClassData.readCP(ClassData.java:151)
        at sun.tools.javap.ClassData.read(ClassData.java:81)
        at sun.tools.javap.ClassData.<init>(ClassData.java:52)
        at sun.tools.javap.JavapPrinter.<init>(JavapPrinter.java:28)
        at sun.tools.javap.Main.displayResults(Main.java:201)
        at sun.tools.javap.Main.perform(Main.java:61)
        at sun.tools.javap.Main.entry(Main.java:49)
        at sun.tools.javap.Main.main(Main.java:34)
ERROR:fatal exception
Exception in thread "main" java.lang.NullPointerException
        at sun.tools.javap.JavapPrinter.javaclassname(JavapPrinter.java:791)
        at sun.tools.javap.JavapPrinter.printclassHeader(JavapPrinter.java:60)
        at sun.tools.javap.JavapPrinter.print(JavapPrinter.java:36)
        at sun.tools.javap.Main.displayResults(Main.java:202)
        at sun.tools.javap.Main.perform(Main.java:61)
        at sun.tools.javap.Main.entry(Main.java:49)
        at sun.tools.javap.Main.main(Main.java:34)

Do you want me to attach the class file here or send it to you so you can take a closer look?

> [classlib][pack200] Performance improvements for pack200
> --------------------------------------------------------
>
>                 Key: HARMONY-5882
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5882
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M6
>         Environment: Pack200 HEAD
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>         Attachments: main.patch, test.patch
>
>
> Attached are some performance improvements for Pack200. They do two things:
>  1. Remove unnecessary conversions to UTF-8 in CPUTF8
>  2. Cache array lookup in SegmentConstantPool
> Hope they work - this is my first try at applying a fix since I've forked.

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


[jira] Commented: (HARMONY-5882) [classlib][pack200] Performance improvements for pack200

Posted by "Andrew Cornwall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12607678#action_12607678 ] 

Andrew Cornwall commented on HARMONY-5882:
------------------------------------------

Sian, I believe your original statement about UTF-8 (which corresponds with my beliefs) is correct, and that Lexer.class is malformed. I say this because when I try to pack it using Sun's tools, I see:

C:\tmp\cputf8>c:\jdk1.5.0_04\bin\pack200.exe -E9 Lexer.pack.gz Lexer.jar
Exception in thread "main" java.io.UTFDataFormatException: malformed input around byte 15
        at java.io.DataInputStream.readUTF(DataInputStream.java:612)
        at java.io.DataInputStream.readUTF(DataInputStream.java:522)
        at com.sun.java.util.jar.pack.ClassReader.readConstantPool(ClassReader.java:185)
        at com.sun.java.util.jar.pack.ClassReader.read(ClassReader.java:123)
        at com.sun.java.util.jar.pack.PackerImpl$DoPack.readClass(PackerImpl.java:491)
        at com.sun.java.util.jar.pack.PackerImpl$DoPack.run(PackerImpl.java:465)
        at com.sun.java.util.jar.pack.PackerImpl.pack(PackerImpl.java:73)
        at com.sun.java.util.jar.pack.Driver.main(Driver.java:261)

Are you by chance using your pack utility to pack it?


> [classlib][pack200] Performance improvements for pack200
> --------------------------------------------------------
>
>                 Key: HARMONY-5882
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5882
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M6
>         Environment: Pack200 HEAD
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>         Attachments: Lexer.class, main.patch, test.patch
>
>
> Attached are some performance improvements for Pack200. They do two things:
>  1. Remove unnecessary conversions to UTF-8 in CPUTF8
>  2. Cache array lookup in SegmentConstantPool
> Hope they work - this is my first try at applying a fix since I've forked.

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


[jira] Commented: (HARMONY-5882) [classlib][pack200] Performance improvements for pack200

Posted by "Nathan Beyer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12607451#action_12607451 ] 

Nathan Beyer commented on HARMONY-5882:
---------------------------------------

Why do you think that the "conversion" to UTF-8 isn't necessary in the CPUTF8 class?

A call to ANY of the String.getBytes methods performs a conversion (an encoding). The suggested change would actually just use the operating system's default character set for encoding the String into bytes. For example, on a Windows machine in the US, this would encode the String into a Windows-1252 (CP1252) byte[], which isn't UTF-8.

> [classlib][pack200] Performance improvements for pack200
> --------------------------------------------------------
>
>                 Key: HARMONY-5882
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5882
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M6
>         Environment: Pack200 HEAD
>            Reporter: Andrew Cornwall
>         Attachments: main.patch, test.patch
>
>
> Attached are some performance improvements for Pack200. They do two things:
>  1. Remove unnecessary conversions to UTF-8 in CPUTF8
>  2. Cache array lookup in SegmentConstantPool
> Hope they work - this is my first try at applying a fix since I've forked.

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


[jira] Closed: (HARMONY-5882) [classlib][pack200] Performance improvements for pack200

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

Andrew Cornwall closed HARMONY-5882.
------------------------------------


Patch applied as expected. Thanks!

> [classlib][pack200] Performance improvements for pack200
> --------------------------------------------------------
>
>                 Key: HARMONY-5882
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5882
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M6
>         Environment: Pack200 HEAD
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>             Fix For: 5.0M7
>
>         Attachments: Lexer.class, main.updated.patch, test.updated.patch
>
>
> Attached are some performance improvements for Pack200. They do two things:
>  1. Remove unnecessary conversions to UTF-8 in CPUTF8
>  2. Cache array lookup in SegmentConstantPool
> Hope they work - this is my first try at applying a fix since I've forked.

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


[jira] Updated: (HARMONY-5882) [classlib][pack200] Performance improvements for pack200

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

Andrew Cornwall updated HARMONY-5882:
-------------------------------------

    Attachment:     (was: test.updated.patch)

> [classlib][pack200] Performance improvements for pack200
> --------------------------------------------------------
>
>                 Key: HARMONY-5882
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5882
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M6
>         Environment: Pack200 HEAD
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>         Attachments: Lexer.class
>
>
> Attached are some performance improvements for Pack200. They do two things:
>  1. Remove unnecessary conversions to UTF-8 in CPUTF8
>  2. Cache array lookup in SegmentConstantPool
> Hope they work - this is my first try at applying a fix since I've forked.

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


[jira] Commented: (HARMONY-5882) [classlib][pack200] Performance improvements for pack200

Posted by "Sian January (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12607626#action_12607626 ] 

Sian January commented on HARMONY-5882:
---------------------------------------

Not seeing the problem if I revert CPUTF8, so it looks like we might need the UTF-8 encoding after all.

> [classlib][pack200] Performance improvements for pack200
> --------------------------------------------------------
>
>                 Key: HARMONY-5882
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5882
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M6
>         Environment: Pack200 HEAD
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>         Attachments: main.patch, test.patch
>
>
> Attached are some performance improvements for Pack200. They do two things:
>  1. Remove unnecessary conversions to UTF-8 in CPUTF8
>  2. Cache array lookup in SegmentConstantPool
> Hope they work - this is my first try at applying a fix since I've forked.

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


[jira] Resolved: (HARMONY-5882) [classlib][pack200] Performance improvements for pack200

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

Sian January resolved HARMONY-5882.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 5.0M7

Applied patch at r671920.  Andrew - please check that it was applied as expected.

> [classlib][pack200] Performance improvements for pack200
> --------------------------------------------------------
>
>                 Key: HARMONY-5882
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5882
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M6
>         Environment: Pack200 HEAD
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>             Fix For: 5.0M7
>
>         Attachments: Lexer.class, main.updated.patch, test.updated.patch
>
>
> Attached are some performance improvements for Pack200. They do two things:
>  1. Remove unnecessary conversions to UTF-8 in CPUTF8
>  2. Cache array lookup in SegmentConstantPool
> Hope they work - this is my first try at applying a fix since I've forked.

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


[jira] Updated: (HARMONY-5882) [classlib][pack200] Performance improvements for pack200

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

Andrew Cornwall updated HARMONY-5882:
-------------------------------------

    Attachment: test.updated.patch
                main.updated.patch

(I've left SegmentConstantPoolArrayCache public so the JUnit tests which exercise it still work.)

> [classlib][pack200] Performance improvements for pack200
> --------------------------------------------------------
>
>                 Key: HARMONY-5882
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5882
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M6
>         Environment: Pack200 HEAD
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>         Attachments: Lexer.class, main.updated.patch, test.updated.patch
>
>
> Attached are some performance improvements for Pack200. They do two things:
>  1. Remove unnecessary conversions to UTF-8 in CPUTF8
>  2. Cache array lookup in SegmentConstantPool
> Hope they work - this is my first try at applying a fix since I've forked.

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


[jira] Commented: (HARMONY-5882) [classlib][pack200] Performance improvements for pack200

Posted by "Aleksey Shipilev (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12607397#action_12607397 ] 

Aleksey Shipilev commented on HARMONY-5882:
-------------------------------------------

Andrew, what is the contract for this cache? Should it be synchronized externally? 

> [classlib][pack200] Performance improvements for pack200
> --------------------------------------------------------
>
>                 Key: HARMONY-5882
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5882
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M6
>         Environment: Pack200 HEAD
>            Reporter: Andrew Cornwall
>         Attachments: main.patch, test.patch
>
>
> Attached are some performance improvements for Pack200. They do two things:
>  1. Remove unnecessary conversions to UTF-8 in CPUTF8
>  2. Cache array lookup in SegmentConstantPool
> Hope they work - this is my first try at applying a fix since I've forked.

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


[jira] Updated: (HARMONY-5882) [classlib][pack200] Performance improvements for pack200

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

Andrew Cornwall updated HARMONY-5882:
-------------------------------------

    Attachment:     (was: test.patch)

> [classlib][pack200] Performance improvements for pack200
> --------------------------------------------------------
>
>                 Key: HARMONY-5882
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5882
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M6
>         Environment: Pack200 HEAD
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>         Attachments: Lexer.class, main.updated.patch, test.updated.patch
>
>
> Attached are some performance improvements for Pack200. They do two things:
>  1. Remove unnecessary conversions to UTF-8 in CPUTF8
>  2. Cache array lookup in SegmentConstantPool
> Hope they work - this is my first try at applying a fix since I've forked.

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


[jira] Commented: (HARMONY-5882) [classlib][pack200] Performance improvements for pack200

Posted by "Nathan Beyer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12607449#action_12607449 ] 

Nathan Beyer commented on HARMONY-5882:
---------------------------------------

Interfaces (java.util.List) are preferred over implementations (java.util.ArrayList) for type declarations.

Rather than creating the NOT_FOUND List, try using Collections.EMPTY_LIST.

I prefer to use 'collection.isEmpty()' over 'collection.size() == 0' for testing a collection to see if it's empty.

The 'CachedArray' class creates one HashMap for 'primaryTable' in the initializer and one HashMap in the constructor, which just overwrites the previously created instance.

The method 'cacheArray(String[])' method throws an Error, which are rarely, if ever thrown. Since this is a somewhat public API, I think an IllegalArgumentException would better fit the intention.

Are the scopes appropriate on this new class? Does it need to be public? The default (package-private) scope seems more appropriate.

> [classlib][pack200] Performance improvements for pack200
> --------------------------------------------------------
>
>                 Key: HARMONY-5882
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5882
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M6
>         Environment: Pack200 HEAD
>            Reporter: Andrew Cornwall
>         Attachments: main.patch, test.patch
>
>
> Attached are some performance improvements for Pack200. They do two things:
>  1. Remove unnecessary conversions to UTF-8 in CPUTF8
>  2. Cache array lookup in SegmentConstantPool
> Hope they work - this is my first try at applying a fix since I've forked.

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


[jira] Commented: (HARMONY-5882) [classlib][pack200] Performance improvements for pack200

Posted by "Nathan Beyer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12607830#action_12607830 ] 

Nathan Beyer commented on HARMONY-5882:
---------------------------------------

You can test the class by putting the test in the same package as the source. It doesn't need to be public.

> [classlib][pack200] Performance improvements for pack200
> --------------------------------------------------------
>
>                 Key: HARMONY-5882
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5882
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M6
>         Environment: Pack200 HEAD
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>         Attachments: Lexer.class, main.updated.patch, test.updated.patch
>
>
> Attached are some performance improvements for Pack200. They do two things:
>  1. Remove unnecessary conversions to UTF-8 in CPUTF8
>  2. Cache array lookup in SegmentConstantPool
> Hope they work - this is my first try at applying a fix since I've forked.

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


[jira] Updated: (HARMONY-5882) [classlib][pack200] Performance improvements for pack200

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

Andrew Cornwall updated HARMONY-5882:
-------------------------------------

    Attachment: test.updated.patch
                main.updated.patch

(patched correct version this time)

> [classlib][pack200] Performance improvements for pack200
> --------------------------------------------------------
>
>                 Key: HARMONY-5882
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5882
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M6
>         Environment: Pack200 HEAD
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>         Attachments: Lexer.class, main.updated.patch, test.updated.patch
>
>
> Attached are some performance improvements for Pack200. They do two things:
>  1. Remove unnecessary conversions to UTF-8 in CPUTF8
>  2. Cache array lookup in SegmentConstantPool
> Hope they work - this is my first try at applying a fix since I've forked.

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


[jira] Updated: (HARMONY-5882) [classlib][pack200] Performance improvements for pack200

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

Sian January updated HARMONY-5882:
----------------------------------

    Attachment: Lexer.class

Attached the broken class file

> [classlib][pack200] Performance improvements for pack200
> --------------------------------------------------------
>
>                 Key: HARMONY-5882
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5882
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M6
>         Environment: Pack200 HEAD
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>         Attachments: Lexer.class, main.patch, test.patch
>
>
> Attached are some performance improvements for Pack200. They do two things:
>  1. Remove unnecessary conversions to UTF-8 in CPUTF8
>  2. Cache array lookup in SegmentConstantPool
> Hope they work - this is my first try at applying a fix since I've forked.

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


[jira] Commented: (HARMONY-5882) [classlib][pack200] Performance improvements for pack200

Posted by "Andrew Cornwall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12607691#action_12607691 ] 

Andrew Cornwall commented on HARMONY-5882:
------------------------------------------

Interesting. I've just learned about "modified UTF8" (http://java.sun.com/javase/6/docs/api/java/io/DataInput.html#modified-utf-8) which is what we should have been using all along to write out CPUTF8s, but have not.

I've attached main.updated.patch and test.updated.patch which take all Nathan and Aleksey's changes into account, and also fixes the real defect with CPUTF8.


> [classlib][pack200] Performance improvements for pack200
> --------------------------------------------------------
>
>                 Key: HARMONY-5882
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5882
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M6
>         Environment: Pack200 HEAD
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>         Attachments: Lexer.class, main.updated.patch, test.updated.patch
>
>
> Attached are some performance improvements for Pack200. They do two things:
>  1. Remove unnecessary conversions to UTF-8 in CPUTF8
>  2. Cache array lookup in SegmentConstantPool
> Hope they work - this is my first try at applying a fix since I've forked.

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


[jira] Assigned: (HARMONY-5882) [classlib][pack200] Performance improvements for pack200

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

Sian January reassigned HARMONY-5882:
-------------------------------------

    Assignee: Sian January

> [classlib][pack200] Performance improvements for pack200
> --------------------------------------------------------
>
>                 Key: HARMONY-5882
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5882
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M6
>         Environment: Pack200 HEAD
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>         Attachments: main.patch, test.patch
>
>
> Attached are some performance improvements for Pack200. They do two things:
>  1. Remove unnecessary conversions to UTF-8 in CPUTF8
>  2. Cache array lookup in SegmentConstantPool
> Hope they work - this is my first try at applying a fix since I've forked.

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


[jira] Commented: (HARMONY-5882) [classlib][pack200] Performance improvements for pack200

Posted by "Andrew Cornwall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12607675#action_12607675 ] 

Andrew Cornwall commented on HARMONY-5882:
------------------------------------------

Aleksey: Yes, the cache must be synchronized externally.

Nathan: thanks for the suggested changes. I agree with them all. However, I can't figure out how to implement a test case for SegmentConstantPoolArrayCache if it's not public. Is there a "standard" way to do this?


> [classlib][pack200] Performance improvements for pack200
> --------------------------------------------------------
>
>                 Key: HARMONY-5882
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5882
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M6
>         Environment: Pack200 HEAD
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>         Attachments: Lexer.class, main.patch, test.patch
>
>
> Attached are some performance improvements for Pack200. They do two things:
>  1. Remove unnecessary conversions to UTF-8 in CPUTF8
>  2. Cache array lookup in SegmentConstantPool
> Hope they work - this is my first try at applying a fix since I've forked.

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


[jira] Updated: (HARMONY-5882) [classlib][pack200] Performance improvements for pack200

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

Andrew Cornwall updated HARMONY-5882:
-------------------------------------

    Attachment:     (was: main.patch)

> [classlib][pack200] Performance improvements for pack200
> --------------------------------------------------------
>
>                 Key: HARMONY-5882
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5882
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M6
>         Environment: Pack200 HEAD
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>         Attachments: Lexer.class, main.updated.patch, test.updated.patch
>
>
> Attached are some performance improvements for Pack200. They do two things:
>  1. Remove unnecessary conversions to UTF-8 in CPUTF8
>  2. Cache array lookup in SegmentConstantPool
> Hope they work - this is my first try at applying a fix since I've forked.

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


[jira] Commented: (HARMONY-5882) [classlib][pack200] Performance improvements for pack200

Posted by "Nathan Beyer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12607837#action_12607837 ] 

Nathan Beyer commented on HARMONY-5882:
---------------------------------------

In case it's not clear, the reason you have to use UTF-8 ("modified utf" in this case); the class file format dictates it - http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html

> [classlib][pack200] Performance improvements for pack200
> --------------------------------------------------------
>
>                 Key: HARMONY-5882
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5882
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M6
>         Environment: Pack200 HEAD
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>         Attachments: Lexer.class, main.updated.patch, test.updated.patch
>
>
> Attached are some performance improvements for Pack200. They do two things:
>  1. Remove unnecessary conversions to UTF-8 in CPUTF8
>  2. Cache array lookup in SegmentConstantPool
> Hope they work - this is my first try at applying a fix since I've forked.

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


[jira] Updated: (HARMONY-5882) [classlib][pack200] Performance improvements for pack200

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

Andrew Cornwall updated HARMONY-5882:
-------------------------------------

    Comment: was deleted

> [classlib][pack200] Performance improvements for pack200
> --------------------------------------------------------
>
>                 Key: HARMONY-5882
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5882
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M6
>         Environment: Pack200 HEAD
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>         Attachments: Lexer.class, main.patch, test.patch
>
>
> Attached are some performance improvements for Pack200. They do two things:
>  1. Remove unnecessary conversions to UTF-8 in CPUTF8
>  2. Cache array lookup in SegmentConstantPool
> Hope they work - this is my first try at applying a fix since I've forked.

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


[jira] Commented: (HARMONY-5882) [classlib][pack200] Performance improvements for pack200

Posted by "Andrew Cornwall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12607665#action_12607665 ] 

Andrew Cornwall commented on HARMONY-5882:
------------------------------------------

Drat - I was hoping everything was correctly encoded already by virtue of it being in the Pack200 stream. Could you please send me the file so I can play with it?

Thanks...

> [classlib][pack200] Performance improvements for pack200
> --------------------------------------------------------
>
>                 Key: HARMONY-5882
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5882
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M6
>         Environment: Pack200 HEAD
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>         Attachments: main.patch, test.patch
>
>
> Attached are some performance improvements for Pack200. They do two things:
>  1. Remove unnecessary conversions to UTF-8 in CPUTF8
>  2. Cache array lookup in SegmentConstantPool
> Hope they work - this is my first try at applying a fix since I've forked.

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


[jira] Updated: (HARMONY-5882) [classlib][pack200] Performance improvements for pack200

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

Andrew Cornwall updated HARMONY-5882:
-------------------------------------

    Attachment:     (was: main.updated.patch)

> [classlib][pack200] Performance improvements for pack200
> --------------------------------------------------------
>
>                 Key: HARMONY-5882
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5882
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M6
>         Environment: Pack200 HEAD
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>         Attachments: Lexer.class
>
>
> Attached are some performance improvements for Pack200. They do two things:
>  1. Remove unnecessary conversions to UTF-8 in CPUTF8
>  2. Cache array lookup in SegmentConstantPool
> Hope they work - this is my first try at applying a fix since I've forked.

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


[jira] Commented: (HARMONY-5882) [classlib][pack200] Performance improvements for pack200

Posted by "Nathan Beyer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12607829#action_12607829 ] 

Nathan Beyer commented on HARMONY-5882:
---------------------------------------

You must encode the String if you want a UTF-8 byte stream. Things failed because you were using the default encoding. If you have a DataOutput or DataInput, then just use the 'writeUTF' and 'readUTF'. These methods do the modified utf-8 encoding mentioned. This is exactly what the javap tool does.

> [classlib][pack200] Performance improvements for pack200
> --------------------------------------------------------
>
>                 Key: HARMONY-5882
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5882
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M6
>         Environment: Pack200 HEAD
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>         Attachments: Lexer.class, main.updated.patch, test.updated.patch
>
>
> Attached are some performance improvements for Pack200. They do two things:
>  1. Remove unnecessary conversions to UTF-8 in CPUTF8
>  2. Cache array lookup in SegmentConstantPool
> Hope they work - this is my first try at applying a fix since I've forked.

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


[jira] Updated: (HARMONY-5882) [classlib][pack200] Performance improvements for pack200

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

Andrew Cornwall updated HARMONY-5882:
-------------------------------------

    Comment: was deleted

> [classlib][pack200] Performance improvements for pack200
> --------------------------------------------------------
>
>                 Key: HARMONY-5882
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5882
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M6
>         Environment: Pack200 HEAD
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>         Attachments: Lexer.class, main.updated.patch, test.updated.patch
>
>
> Attached are some performance improvements for Pack200. They do two things:
>  1. Remove unnecessary conversions to UTF-8 in CPUTF8
>  2. Cache array lookup in SegmentConstantPool
> Hope they work - this is my first try at applying a fix since I've forked.

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


[jira] Commented: (HARMONY-5882) [classlib][pack200] Performance improvements for pack200

Posted by "Sian January (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12607552#action_12607552 ] 

Sian January commented on HARMONY-5882:
---------------------------------------

Nathan - to answer your second point the UTF8's in pack200 don't actually correspond to UTF-8 encoded Strings, just to Strings in general.  

Quoting from the spec: "The name "Utf8" is an anachronism, referring only to the basic character string type in Java class files. No part of the Pack200 file format uses any UTF encoding, but the term "Utf8" is retained to emphasize the connection with class files"

> [classlib][pack200] Performance improvements for pack200
> --------------------------------------------------------
>
>                 Key: HARMONY-5882
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5882
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M6
>         Environment: Pack200 HEAD
>            Reporter: Andrew Cornwall
>         Attachments: main.patch, test.patch
>
>
> Attached are some performance improvements for Pack200. They do two things:
>  1. Remove unnecessary conversions to UTF-8 in CPUTF8
>  2. Cache array lookup in SegmentConstantPool
> Hope they work - this is my first try at applying a fix since I've forked.

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


[jira] Commented: (HARMONY-5882) [classlib][pack200] Performance improvements for pack200

Posted by "Sian January (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12608382#action_12608382 ] 

Sian January commented on HARMONY-5882:
---------------------------------------

Andrew - the latest patch is passing my tests now so I'm happy to check it in once we've resolved the public field issue.  On this issue, I would have thought that the three methods on SegmentConstantPoolArrayCache should be public (indexesForArrayKey, arrayIsCached and cacheArray) and then the tests can use those methods instead of accessing the field directly.  Does that sound reasonable?

> [classlib][pack200] Performance improvements for pack200
> --------------------------------------------------------
>
>                 Key: HARMONY-5882
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5882
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M6
>         Environment: Pack200 HEAD
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>         Attachments: Lexer.class, main.updated.patch, test.updated.patch
>
>
> Attached are some performance improvements for Pack200. They do two things:
>  1. Remove unnecessary conversions to UTF-8 in CPUTF8
>  2. Cache array lookup in SegmentConstantPool
> Hope they work - this is my first try at applying a fix since I've forked.

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