You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Tim Ellison (JIRA)" <ji...@apache.org> on 2008/02/11 14:55:07 UTC

[jira] Created: (HARMONY-5488) [classlib][nio] Scatter/gather calls should use OS functionality

[classlib][nio] Scatter/gather calls should use OS functionality
----------------------------------------------------------------

                 Key: HARMONY-5488
                 URL: https://issues.apache.org/jira/browse/HARMONY-5488
             Project: Harmony
          Issue Type: Improvement
          Components: Classlib
            Reporter: Tim Ellison


I just noticed that our NIO implementation of scatter / gather calls (e.g. o.a.h.nio.internal.SocketChannelImpl#write(ByteBuffer[],int,int)) are actually copying the data into a single Java heap buffer before calling the OS! :-(  and FileChannelImpl copies into a single direct byte buffer.

These need to be reimplemented in terms of the OS scatter/gather capabilities to avoid copying.


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


[jira] Commented: (HARMONY-5488) [classlib][nio] Scatter/gather calls should use OS functionality

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12591311#action_12591311 ] 

Tim Ellison commented on HARMONY-5488:
--------------------------------------

No, I'm thinking more along the lines of extending the portlib with wrappers to native socket and file IO functionality like readv and writev in unixes and equivalent functionality on windows

http://msdn2.microsoft.com/en-us/library/ms740138(VS.85).aspx
http://msdn2.microsoft.com/en-us/library/aa365472.aspx


> [classlib][nio] Scatter/gather calls should use OS functionality
> ----------------------------------------------------------------
>
>                 Key: HARMONY-5488
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5488
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>            Reporter: Tim Ellison
>         Attachments: Harmony-5488.diff
>
>
> I just noticed that our NIO implementation of scatter / gather calls (e.g. o.a.h.nio.internal.SocketChannelImpl#write(ByteBuffer[],int,int)) are actually copying the data into a single Java heap buffer before calling the OS! :-(  and FileChannelImpl copies into a single direct byte buffer.
> These need to be reimplemented in terms of the OS scatter/gather capabilities to avoid copying.

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


[jira] Updated: (HARMONY-5488) [classlib][nio] Scatter/gather calls should use OS functionality

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

Sean Qiu updated HARMONY-5488:
------------------------------

    Attachment: Harmony-5488.diff

Hi, Tim.
Do you mean this way in my patch?

I have tested both implementation, it seem that when the content of each ByteBuffer is big.
Writing with os function has better performance.

If you think this approach is ok, i can apply other patches for other similar classes.Thanks

> [classlib][nio] Scatter/gather calls should use OS functionality
> ----------------------------------------------------------------
>
>                 Key: HARMONY-5488
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5488
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>            Reporter: Tim Ellison
>         Attachments: Harmony-5488.diff
>
>
> I just noticed that our NIO implementation of scatter / gather calls (e.g. o.a.h.nio.internal.SocketChannelImpl#write(ByteBuffer[],int,int)) are actually copying the data into a single Java heap buffer before calling the OS! :-(  and FileChannelImpl copies into a single direct byte buffer.
> These need to be reimplemented in terms of the OS scatter/gather capabilities to avoid copying.

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


[jira] Commented: (HARMONY-5488) [classlib][nio] Scatter/gather calls should use OS functionality

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12592077#action_12592077 ] 

Tim Ellison commented on HARMONY-5488:
--------------------------------------

You are welcome to work in this area, but it is quite a big job, so I would expect you'll need a few patches for portlib changes, natives and Platform changes, and eventually flow up to the java APIs.

Good luck!

> [classlib][nio] Scatter/gather calls should use OS functionality
> ----------------------------------------------------------------
>
>                 Key: HARMONY-5488
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5488
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>            Reporter: Tim Ellison
>         Attachments: Harmony-5488.diff
>
>
> I just noticed that our NIO implementation of scatter / gather calls (e.g. o.a.h.nio.internal.SocketChannelImpl#write(ByteBuffer[],int,int)) are actually copying the data into a single Java heap buffer before calling the OS! :-(  and FileChannelImpl copies into a single direct byte buffer.
> These need to be reimplemented in terms of the OS scatter/gather capabilities to avoid copying.

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


[jira] Commented: (HARMONY-5488) [classlib][nio] Scatter/gather calls should use OS functionality

Posted by "Sean Qiu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12591593#action_12591593 ] 

Sean Qiu commented on HARMONY-5488:
-----------------------------------

Thanks a lot for you explanation.
I will try to attach another patch as you described.

> [classlib][nio] Scatter/gather calls should use OS functionality
> ----------------------------------------------------------------
>
>                 Key: HARMONY-5488
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5488
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>            Reporter: Tim Ellison
>         Attachments: Harmony-5488.diff
>
>
> I just noticed that our NIO implementation of scatter / gather calls (e.g. o.a.h.nio.internal.SocketChannelImpl#write(ByteBuffer[],int,int)) are actually copying the data into a single Java heap buffer before calling the OS! :-(  and FileChannelImpl copies into a single direct byte buffer.
> These need to be reimplemented in terms of the OS scatter/gather capabilities to avoid copying.

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