You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Boris Kuznetsov (JIRA)" <ji...@apache.org> on 2007/06/04 15:00:37 UTC

[jira] Created: (HARMONY-4039) [classlib][luni] Socket implementation is too slow

[classlib][luni] Socket implementation is too slow
--------------------------------------------------

                 Key: HARMONY-4039
                 URL: https://issues.apache.org/jira/browse/HARMONY-4039
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Boris Kuznetsov


I noticed that Harmony classlib works too slowly with MySQL (both on DRLVM and Jrockit).
The reason is the socket implementation: availableStreamImpl uses 1 ms timeout for hysock_select_read().
It leads to 0.015 sec wait on select call for every available().

Here are the test which demonstrate the problem and proposed patch.

harmony-jre-r533500\bin\java test
estimatedTime 15625

After patch applying:
java test
estimatedTime 10


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


[jira] Commented: (HARMONY-4039) [classlib][luni] Socket implementation is too slow

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

Tim Ellison commented on HARMONY-4039:
--------------------------------------

Boris, FYI I still have LUNI tests hang with this patch applied (IBM VME + Harmony r547188), and pass ok without it.  I am still investigating the cause of the hang.

> [classlib][luni] Socket implementation is too slow
> --------------------------------------------------
>
>                 Key: HARMONY-4039
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4039
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Boris Kuznetsov
>            Assignee: Tim Ellison
>         Attachments: patch.txt, test.java
>
>
> I noticed that Harmony classlib works too slowly with MySQL (both on DRLVM and Jrockit).
> The reason is the socket implementation: availableStreamImpl uses 1 ms timeout for hysock_select_read().
> It leads to 0.015 sec wait on select call for every available().
> Here are the test which demonstrate the problem and proposed patch.
> harmony-jre-r533500\bin\java test
> estimatedTime 15625
> After patch applying:
> java test
> estimatedTime 10

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


[jira] Updated: (HARMONY-4039) [classlib][luni] Socket implementation is too slow

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

Boris Kuznetsov updated HARMONY-4039:
-------------------------------------

    Attachment: patch.txt
                test.java

> [classlib][luni] Socket implementation is too slow
> --------------------------------------------------
>
>                 Key: HARMONY-4039
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4039
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Boris Kuznetsov
>         Attachments: patch.txt, test.java
>
>
> I noticed that Harmony classlib works too slowly with MySQL (both on DRLVM and Jrockit).
> The reason is the socket implementation: availableStreamImpl uses 1 ms timeout for hysock_select_read().
> It leads to 0.015 sec wait on select call for every available().
> Here are the test which demonstrate the problem and proposed patch.
> harmony-jre-r533500\bin\java test
> estimatedTime 15625
> After patch applying:
> java test
> estimatedTime 10

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


[jira] Commented: (HARMONY-4039) [classlib][luni] Socket implementation is too slow

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

Boris Kuznetsov commented on HARMONY-4039:
------------------------------------------

Tim, I've just tried the patch with IBM VM. Results are similar to DRLVM and JRockit:
For the attached test: estimatedTime 15625
and after patch applying: estimatedTime 16

The idea of this path is to use zero timeout for hysock_select_read() in the availableStreamImpl()
But hysock_select_read() is called with zero timeout from pollSelectRead() also (see socket.c), and windows implementation of hysock_select_read() resets timeout to 100 ms. I don't know the reason of such implementation, so I used existent parameter 'accept' to distinguish calls from availableStreamImpl() and pollSelectRead(). (Note, this parameter was not used before.) Possibly it should be renamed.


> [classlib][luni] Socket implementation is too slow
> --------------------------------------------------
>
>                 Key: HARMONY-4039
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4039
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Boris Kuznetsov
>            Assignee: Tim Ellison
>         Attachments: patch.txt, test.java
>
>
> I noticed that Harmony classlib works too slowly with MySQL (both on DRLVM and Jrockit).
> The reason is the socket implementation: availableStreamImpl uses 1 ms timeout for hysock_select_read().
> It leads to 0.015 sec wait on select call for every available().
> Here are the test which demonstrate the problem and proposed patch.
> harmony-jre-r533500\bin\java test
> estimatedTime 15625
> After patch applying:
> java test
> estimatedTime 10

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


[jira] Assigned: (HARMONY-4039) [classlib][luni] Socket implementation is too slow

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

Tim Ellison reassigned HARMONY-4039:
------------------------------------

    Assignee: Tim Ellison

> [classlib][luni] Socket implementation is too slow
> --------------------------------------------------
>
>                 Key: HARMONY-4039
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4039
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Boris Kuznetsov
>            Assignee: Tim Ellison
>         Attachments: patch.txt, test.java
>
>
> I noticed that Harmony classlib works too slowly with MySQL (both on DRLVM and Jrockit).
> The reason is the socket implementation: availableStreamImpl uses 1 ms timeout for hysock_select_read().
> It leads to 0.015 sec wait on select call for every available().
> Here are the test which demonstrate the problem and proposed patch.
> harmony-jre-r533500\bin\java test
> estimatedTime 15625
> After patch applying:
> java test
> estimatedTime 10

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


[jira] Commented: (HARMONY-4039) [classlib][luni] Socket implementation is too slow

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

Tim Ellison commented on HARMONY-4039:
--------------------------------------

Boris,  I'm struggling to understand the patch, and the effect is that the LUNI tests on the IBM VM.  Please can you tell me if you tested with the IBM VM too (i.e. if the problem is unique to that VM) and why the accept flag is being modified in this way?

Thanks.

> [classlib][luni] Socket implementation is too slow
> --------------------------------------------------
>
>                 Key: HARMONY-4039
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4039
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Boris Kuznetsov
>            Assignee: Tim Ellison
>         Attachments: patch.txt, test.java
>
>
> I noticed that Harmony classlib works too slowly with MySQL (both on DRLVM and Jrockit).
> The reason is the socket implementation: availableStreamImpl uses 1 ms timeout for hysock_select_read().
> It leads to 0.015 sec wait on select call for every available().
> Here are the test which demonstrate the problem and proposed patch.
> harmony-jre-r533500\bin\java test
> estimatedTime 15625
> After patch applying:
> java test
> estimatedTime 10

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


[jira] Commented: (HARMONY-4039) [classlib][luni] Socket implementation is too slow

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

Sergey Dmitriev commented on HARMONY-4039:
------------------------------------------

I am just wondering about the difference of hysock_select_read() implememtation on Linux and Windows.

On Windows we have a loop with hysock_select() inside and (quote):
    /* break out of the loop if we should not be looping (timeout is zero) or
      * if an error occured or data ready to be read */

On Linux we don't have such a loop - we have a single call of hysock_select().

Just an interesting fact.


> [classlib][luni] Socket implementation is too slow
> --------------------------------------------------
>
>                 Key: HARMONY-4039
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4039
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Boris Kuznetsov
>            Assignee: Tim Ellison
>         Attachments: patch.txt, test.java
>
>
> I noticed that Harmony classlib works too slowly with MySQL (both on DRLVM and Jrockit).
> The reason is the socket implementation: availableStreamImpl uses 1 ms timeout for hysock_select_read().
> It leads to 0.015 sec wait on select call for every available().
> Here are the test which demonstrate the problem and proposed patch.
> harmony-jre-r533500\bin\java test
> estimatedTime 15625
> After patch applying:
> java test
> estimatedTime 10

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


[jira] Commented: (HARMONY-4039) [classlib][luni] Socket implementation is too slow

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

Sergey Dmitriev commented on HARMONY-4039:
------------------------------------------

This issue intersects a little bit with HARMONY-4077. Both issues are about portlib/luni sockets.

I see not conflicts in files since the HARMONY-4077 fixes only unix part but this issue deals with shared+windows parts.



> [classlib][luni] Socket implementation is too slow
> --------------------------------------------------
>
>                 Key: HARMONY-4039
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4039
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Boris Kuznetsov
>            Assignee: Tim Ellison
>         Attachments: patch.txt, test.java
>
>
> I noticed that Harmony classlib works too slowly with MySQL (both on DRLVM and Jrockit).
> The reason is the socket implementation: availableStreamImpl uses 1 ms timeout for hysock_select_read().
> It leads to 0.015 sec wait on select call for every available().
> Here are the test which demonstrate the problem and proposed patch.
> harmony-jre-r533500\bin\java test
> estimatedTime 15625
> After patch applying:
> java test
> estimatedTime 10

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


[jira] Assigned: (HARMONY-4039) [classlib][luni] Socket implementation is too slow

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

Tim Ellison reassigned HARMONY-4039:
------------------------------------

    Assignee:     (was: Tim Ellison)

I'm taking my name off this issue since I have not progressed it for so long.
Sorry for sitting on it, and perhaps somebody else will have more luck in making it work.

> [classlib][luni] Socket implementation is too slow
> --------------------------------------------------
>
>                 Key: HARMONY-4039
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4039
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Boris Kuznetsov
>         Attachments: patch.txt, test.java
>
>
> I noticed that Harmony classlib works too slowly with MySQL (both on DRLVM and Jrockit).
> The reason is the socket implementation: availableStreamImpl uses 1 ms timeout for hysock_select_read().
> It leads to 0.015 sec wait on select call for every available().
> Here are the test which demonstrate the problem and proposed patch.
> harmony-jre-r533500\bin\java test
> estimatedTime 15625
> After patch applying:
> java test
> estimatedTime 10

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


[jira] Assigned: (HARMONY-4039) [classlib][luni] Socket implementation is too slow

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

Tim Ellison reassigned HARMONY-4039:
------------------------------------

    Assignee: Tim Ellison

> [classlib][luni] Socket implementation is too slow
> --------------------------------------------------
>
>                 Key: HARMONY-4039
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4039
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Boris Kuznetsov
>            Assignee: Tim Ellison
>         Attachments: patch.txt, test.java
>
>
> I noticed that Harmony classlib works too slowly with MySQL (both on DRLVM and Jrockit).
> The reason is the socket implementation: availableStreamImpl uses 1 ms timeout for hysock_select_read().
> It leads to 0.015 sec wait on select call for every available().
> Here are the test which demonstrate the problem and proposed patch.
> harmony-jre-r533500\bin\java test
> estimatedTime 15625
> After patch applying:
> java test
> estimatedTime 10

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


[jira] Closed: (HARMONY-4039) [classlib][luni] Socket implementation is too slow

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

Tim Ellison closed HARMONY-4039.
--------------------------------


> [classlib][luni] Socket implementation is too slow
> --------------------------------------------------
>
>                 Key: HARMONY-4039
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4039
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Boris Kuznetsov
>            Assignee: Tim Ellison
>         Attachments: patch.txt, test.java
>
>
> I noticed that Harmony classlib works too slowly with MySQL (both on DRLVM and Jrockit).
> The reason is the socket implementation: availableStreamImpl uses 1 ms timeout for hysock_select_read().
> It leads to 0.015 sec wait on select call for every available().
> Here are the test which demonstrate the problem and proposed patch.
> harmony-jre-r533500\bin\java test
> estimatedTime 15625
> After patch applying:
> java test
> estimatedTime 10

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


[jira] Resolved: (HARMONY-4039) [classlib][luni] Socket implementation is too slow

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

Tim Ellison resolved HARMONY-4039.
----------------------------------

    Resolution: Fixed

I fixed this in r719214, with a different approach to the one you suggested in your original patch.

Now we determine the number of available bytes for a read using a faster ioctl call.


> [classlib][luni] Socket implementation is too slow
> --------------------------------------------------
>
>                 Key: HARMONY-4039
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4039
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Boris Kuznetsov
>            Assignee: Tim Ellison
>         Attachments: patch.txt, test.java
>
>
> I noticed that Harmony classlib works too slowly with MySQL (both on DRLVM and Jrockit).
> The reason is the socket implementation: availableStreamImpl uses 1 ms timeout for hysock_select_read().
> It leads to 0.015 sec wait on select call for every available().
> Here are the test which demonstrate the problem and proposed patch.
> harmony-jre-r533500\bin\java test
> estimatedTime 15625
> After patch applying:
> java test
> estimatedTime 10

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