You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Aleksey Shipilev (JIRA)" <ji...@apache.org> on 2008/03/23 21:03:24 UTC

[jira] Created: (HARMONY-5634) [classlib][luni][performance] ObjectInputStream should use HashMap instead of Hashtable for internal storage

[classlib][luni][performance] ObjectInputStream should use HashMap instead of Hashtable for internal storage
------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-5634
                 URL: https://issues.apache.org/jira/browse/HARMONY-5634
             Project: Harmony
          Issue Type: Improvement
            Reporter: Aleksey Shipilev


For now, ObjectInputStream uses Hashtable for two storages:
 1. static PRIMITIVE_CLASSES, populated via static initializer, read by all instances (e.g. in theory by all threads)
 2. private objectsRead, serving as instance-local buffer

Both of these storages should be migrated to HashMap, since Hashtable.get is synchronized and synchronization is not needed here.

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


[jira] Assigned: (HARMONY-5634) [classlib][luni][performance] ObjectInputStream should use HashMap instead of Hashtable for internal storage

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

Tim Ellison reassigned HARMONY-5634:
------------------------------------

    Assignee: Tim Ellison

> [classlib][luni][performance] ObjectInputStream should use HashMap instead of Hashtable for internal storage
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-5634
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5634
>             Project: Harmony
>          Issue Type: Improvement
>            Reporter: Aleksey Shipilev
>            Assignee: Tim Ellison
>         Attachments: 0002-serial-HashMap.patch
>
>
> For now, ObjectInputStream uses Hashtable for two storages:
>  1. static PRIMITIVE_CLASSES, populated via static initializer, read by all instances (e.g. in theory by all threads)
>  2. private objectsRead, serving as instance-local buffer
> Both of these storages should be migrated to HashMap, since Hashtable.get is synchronized and synchronization is not needed here.

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


[jira] Resolved: (HARMONY-5634) [classlib][luni][performance] ObjectInputStream should use HashMap instead of Hashtable for internal storage

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

Tim Ellison resolved HARMONY-5634.
----------------------------------

    Resolution: Fixed

Thanks Aleksey.

Patch applied to LUNI module at repo revision r641841.
Please check it was applied as you expected.

I didn't make it an unmodifiable collection since it is already a private field, and I'd have to add a field to load the primitives before wrappering it etc.  In this case the extra wrapper seems unnecessary.


> [classlib][luni][performance] ObjectInputStream should use HashMap instead of Hashtable for internal storage
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-5634
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5634
>             Project: Harmony
>          Issue Type: Improvement
>            Reporter: Aleksey Shipilev
>            Assignee: Tim Ellison
>         Attachments: 0002-serial-HashMap.patch
>
>
> For now, ObjectInputStream uses Hashtable for two storages:
>  1. static PRIMITIVE_CLASSES, populated via static initializer, read by all instances (e.g. in theory by all threads)
>  2. private objectsRead, serving as instance-local buffer
> Both of these storages should be migrated to HashMap, since Hashtable.get is synchronized and synchronization is not needed here.

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


[jira] Updated: (HARMONY-5634) [classlib][luni][performance] ObjectInputStream should use HashMap instead of Hashtable for internal storage

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

Aleksey Shipilev updated HARMONY-5634:
--------------------------------------

    Issue Type: Sub-task  (was: Improvement)
        Parent: HARMONY-5632

> [classlib][luni][performance] ObjectInputStream should use HashMap instead of Hashtable for internal storage
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-5634
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5634
>             Project: Harmony
>          Issue Type: Sub-task
>            Reporter: Aleksey Shipilev
>            Assignee: Tim Ellison
>         Attachments: 0002-serial-HashMap.patch
>
>
> For now, ObjectInputStream uses Hashtable for two storages:
>  1. static PRIMITIVE_CLASSES, populated via static initializer, read by all instances (e.g. in theory by all threads)
>  2. private objectsRead, serving as instance-local buffer
> Both of these storages should be migrated to HashMap, since Hashtable.get is synchronized and synchronization is not needed here.

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


[jira] Closed: (HARMONY-5634) [classlib][luni][performance] ObjectInputStream should use HashMap instead of Hashtable for internal storage

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

Aleksey Shipilev closed HARMONY-5634.
-------------------------------------


Thanks Tim, applied as expected.
Closed.

> [classlib][luni][performance] ObjectInputStream should use HashMap instead of Hashtable for internal storage
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-5634
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5634
>             Project: Harmony
>          Issue Type: Improvement
>            Reporter: Aleksey Shipilev
>            Assignee: Tim Ellison
>         Attachments: 0002-serial-HashMap.patch
>
>
> For now, ObjectInputStream uses Hashtable for two storages:
>  1. static PRIMITIVE_CLASSES, populated via static initializer, read by all instances (e.g. in theory by all threads)
>  2. private objectsRead, serving as instance-local buffer
> Both of these storages should be migrated to HashMap, since Hashtable.get is synchronized and synchronization is not needed here.

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


[jira] Updated: (HARMONY-5634) [classlib][luni][performance] ObjectInputStream should use HashMap instead of Hashtable for internal storage

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

Aleksey Shipilev updated HARMONY-5634:
--------------------------------------

    Attachment: 0002-serial-HashMap.patch

0002-serial-HashMap.patch
Changes the HashMap to Hashtable.

This patch may be committed in this form, presumably it's correct.
However, more beautiful solution will be declaring PRIMITIVE_CLASSES as UnmodifiableHashMap.

This patch gives up to +30% boost on SerialBench running at 8-core Clovertown.

> [classlib][luni][performance] ObjectInputStream should use HashMap instead of Hashtable for internal storage
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-5634
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5634
>             Project: Harmony
>          Issue Type: Improvement
>            Reporter: Aleksey Shipilev
>         Attachments: 0002-serial-HashMap.patch
>
>
> For now, ObjectInputStream uses Hashtable for two storages:
>  1. static PRIMITIVE_CLASSES, populated via static initializer, read by all instances (e.g. in theory by all threads)
>  2. private objectsRead, serving as instance-local buffer
> Both of these storages should be migrated to HashMap, since Hashtable.get is synchronized and synchronization is not needed here.

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