harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Varlamov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-3684) [classlib][nio]Refactor and define direct buffer adapters
Date Fri, 20 Apr 2007 10:41:15 GMT

    [ 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.

View raw message