You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Jimmy, Jing Lv (JIRA)" <ji...@apache.org> on 2007/04/18 10:03:15 UTC

[jira] Created: (HARMONY-3684) [classlib][nio]Refactor and define direct buffer adapters

[classlib][nio]Refactor and define direct buffer adapters
---------------------------------------------------------

                 Key: HARMONY-3684
                 URL: https://issues.apache.org/jira/browse/HARMONY-3684
             Project: Harmony
          Issue Type: Improvement
          Components: Classlib
            Reporter: Jimmy, Jing Lv


As discussed on Harmony3591 and mailing-list, the patch of 3591 is workable but not perfect. Define new direct buffer adapters may help to improve infrastructure and code read-ability. 

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


[jira] Updated: (HARMONY-3684) [classlib][nio]Refactor and define direct buffer adapters

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

Jimmy, Jing Lv updated HARMONY-3684:
------------------------------------

    Attachment: Harmony3684.zip

Hi,
    Would you please try my patch? Thanks!
Jimmy

> [classlib][nio]Refactor and define direct buffer adapters
> ---------------------------------------------------------
>
>                 Key: HARMONY-3684
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3684
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>            Reporter: Jimmy, Jing Lv
>         Attachments: Harmony3684.zip
>
>
> As discussed on Harmony3591 and mailing-list, the patch of 3591 is workable but not perfect. Define new direct buffer adapters may help to improve infrastructure and code read-ability. 

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


[jira] Commented: (HARMONY-3684) [classlib][nio]Refactor and define direct buffer adapters

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-3684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12490321 ] 

Alexey Varlamov commented on HARMONY-3684:
------------------------------------------

Jimmy, I looked through the suggested patch and see no much value added: there are the same nasty casts and no promised optimizations:
    public PlatformAddress getBaseAddress() {
        return ((DirectBuffer) byteBuffer).getBaseAddress();
    }

If you still wanna improve this ;), I'd suggest the following:
1) move those asXXXBuffer() methods from BaseByteBuffer to specific childs - then maybe even drop this class altogether (it only provides 4 trivial methods besides the above);
2) keep that wrapped buffer instance as more specific type, e.g.
private final DirectByteBuffer byteBuffer;
3) Look if there are indeed some possibilities to optimize operations, via shortcut package methods or such.

PS. - I wonder why nio.Buffer classes hierarchy is so lavish,e.g. lot of classes like ReadOnlyXXX and ReadWriteXXX. Does it really benefits performance that much or smth else?
At first glance, simple bool flag would do just fine...

> [classlib][nio]Refactor and define direct buffer adapters
> ---------------------------------------------------------
>
>                 Key: HARMONY-3684
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3684
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>            Reporter: Jimmy, Jing Lv
>         Attachments: Harmony3684.zip
>
>
> As discussed on Harmony3591 and mailing-list, the patch of 3591 is workable but not perfect. Define new direct buffer adapters may help to improve infrastructure and code read-ability. 

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


[jira] Assigned: (HARMONY-3684) [classlib][nio]Refactor and define direct buffer adapters

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

Alexey Petrenko reassigned HARMONY-3684:
----------------------------------------

    Assignee: Alexey Petrenko

> [classlib][nio]Refactor and define direct buffer adapters
> ---------------------------------------------------------
>
>                 Key: HARMONY-3684
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3684
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>            Reporter: Jimmy, Jing Lv
>         Assigned To: Alexey Petrenko
>         Attachments: Harmony3684.zip
>
>
> As discussed on Harmony3591 and mailing-list, the patch of 3591 is workable but not perfect. Define new direct buffer adapters may help to improve infrastructure and code read-ability. 

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


[jira] Commented: (HARMONY-3684) [classlib][nio]Refactor and define direct buffer adapters

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-3684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12490322 ] 

Alexey Varlamov commented on HARMONY-3684:
------------------------------------------

Regarding optimizations, what about copying internal representation directly, instead of wrapping a buffer? OTOH that may be too costly for maintenance :(

> [classlib][nio]Refactor and define direct buffer adapters
> ---------------------------------------------------------
>
>                 Key: HARMONY-3684
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3684
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>            Reporter: Jimmy, Jing Lv
>         Attachments: Harmony3684.zip
>
>
> As discussed on Harmony3591 and mailing-list, the patch of 3591 is workable but not perfect. Define new direct buffer adapters may help to improve infrastructure and code read-ability. 

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