You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Marcel Reutegger (JIRA)" <ji...@apache.org> on 2009/09/25 09:30:15 UTC

[jira] Created: (JCR-2327) java.util.UUID.fromString() too slow

java.util.UUID.fromString() too slow
------------------------------------

                 Key: JCR-2327
                 URL: https://issues.apache.org/jira/browse/JCR-2327
             Project: Jackrabbit Content Repository
          Issue Type: Improvement
          Components: jackrabbit-core, jackrabbit-jcr-commons
            Reporter: Marcel Reutegger


Benchmarking shows that the java.util.UUID.fromString() method is 10 times slower than the previous version we used from jackrabbit-jcr-commons. This method is quite heavily used in the query section or more generally whenever a NodeId is created from a String.

I'd like to introduce the custom String UUID parsing code again that we had in the jackrabbit-jcr-commons UUID class and use it in the NodeId(String) constructor.

WDYT?

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


[jira] Resolved: (JCR-2327) java.util.UUID.fromString() too slow

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

Marcel Reutegger resolved JCR-2327.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.0

Re-introduced the UUID string parsing code previously present in jackrabbit-jcr-commons.

svn revision: 831891

> java.util.UUID.fromString() too slow
> ------------------------------------
>
>                 Key: JCR-2327
>                 URL: https://issues.apache.org/jira/browse/JCR-2327
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Marcel Reutegger
>             Fix For: 2.0.0
>
>
> Benchmarking shows that the java.util.UUID.fromString() method is 10 times slower than the previous version we used from jackrabbit-jcr-commons. This method is quite heavily used in the query section or more generally whenever a NodeId is created from a String.
> I'd like to introduce the custom String UUID parsing code again that we had in the jackrabbit-jcr-commons UUID class and use it in the NodeId(String) constructor.
> WDYT?

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


[jira] Commented: (JCR-2327) java.util.UUID.fromString() too slow

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12759421#action_12759421 ] 

Thomas Mueller commented on JCR-2327:
-------------------------------------

+1

Probably you can even ignore some of the strict formatting rules, I propose:

long high = 0, low = 0;
int i = 0;
for (int j = 0; i < s.length() && j < 16; i++) {
    char ch = s.charAt(i);
    if (ch != '-') {
        high = (high << 4) | Character.digit(ch, 16);
        j++;
    }
}
for (int j = 0; i < s.length() && j < 16; i++) {
    char ch = s.charAt(i);
    if (ch != '-') {
        low = (low << 4) | Character.digit(ch, 16);
        j++;
    }
}


> java.util.UUID.fromString() too slow
> ------------------------------------
>
>                 Key: JCR-2327
>                 URL: https://issues.apache.org/jira/browse/JCR-2327
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, jackrabbit-jcr-commons
>            Reporter: Marcel Reutegger
>
> Benchmarking shows that the java.util.UUID.fromString() method is 10 times slower than the previous version we used from jackrabbit-jcr-commons. This method is quite heavily used in the query section or more generally whenever a NodeId is created from a String.
> I'd like to introduce the custom String UUID parsing code again that we had in the jackrabbit-jcr-commons UUID class and use it in the NodeId(String) constructor.
> WDYT?

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


[jira] Commented: (JCR-2327) java.util.UUID.fromString() too slow

Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12759431#action_12759431 ] 

Stefan Guggisberg commented on JCR-2327:
----------------------------------------

> I'd like to introduce the custom String UUID parsing code again that we had in the jackrabbit-jcr-commons UUID class and use it in the NodeId(String) constructor. 
>
> WDYT?

+1

> java.util.UUID.fromString() too slow
> ------------------------------------
>
>                 Key: JCR-2327
>                 URL: https://issues.apache.org/jira/browse/JCR-2327
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Marcel Reutegger
>
> Benchmarking shows that the java.util.UUID.fromString() method is 10 times slower than the previous version we used from jackrabbit-jcr-commons. This method is quite heavily used in the query section or more generally whenever a NodeId is created from a String.
> I'd like to introduce the custom String UUID parsing code again that we had in the jackrabbit-jcr-commons UUID class and use it in the NodeId(String) constructor.
> WDYT?

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


[jira] Reopened: (JCR-2327) java.util.UUID.fromString() too slow

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

Thomas Mueller reopened JCR-2327:
---------------------------------

      Assignee: Thomas Mueller

Creating a NodeId from a String is still a bottleneck. It's relatively easy to improve performance (avoiding creating temporary objects, use switch/case). There are some other issues: some errors are not detected, and the exception should include context information.

> java.util.UUID.fromString() too slow
> ------------------------------------
>
>                 Key: JCR-2327
>                 URL: https://issues.apache.org/jira/browse/JCR-2327
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Marcel Reutegger
>            Assignee: Thomas Mueller
>             Fix For: 2.0-beta4
>
>
> Benchmarking shows that the java.util.UUID.fromString() method is 10 times slower than the previous version we used from jackrabbit-jcr-commons. This method is quite heavily used in the query section or more generally whenever a NodeId is created from a String.
> I'd like to introduce the custom String UUID parsing code again that we had in the jackrabbit-jcr-commons UUID class and use it in the NodeId(String) constructor.
> WDYT?

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


[jira] Commented: (JCR-2327) java.util.UUID.fromString() too slow

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12759425#action_12759425 ] 

Jukka Zitting commented on JCR-2327:
------------------------------------

No objections to reintroducing the old parsing code. On the other hand, IMHO we should avoid having to parse and reformat UUIDs in any performance critical part. Could we use a binary field to store the NodeId?

> java.util.UUID.fromString() too slow
> ------------------------------------
>
>                 Key: JCR-2327
>                 URL: https://issues.apache.org/jira/browse/JCR-2327
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Marcel Reutegger
>
> Benchmarking shows that the java.util.UUID.fromString() method is 10 times slower than the previous version we used from jackrabbit-jcr-commons. This method is quite heavily used in the query section or more generally whenever a NodeId is created from a String.
> I'd like to introduce the custom String UUID parsing code again that we had in the jackrabbit-jcr-commons UUID class and use it in the NodeId(String) constructor.
> WDYT?

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


[jira] Updated: (JCR-2327) java.util.UUID.fromString() too slow

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

Jukka Zitting updated JCR-2327:
-------------------------------

    Component/s:     (was: jackrabbit-jcr-commons)

... In any case I think this should be treated as an internal performance optimization and handled entirely within jackrabbit-core, so I dropped jackrabbit-jcr-commons from the list of affected components.

> java.util.UUID.fromString() too slow
> ------------------------------------
>
>                 Key: JCR-2327
>                 URL: https://issues.apache.org/jira/browse/JCR-2327
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Marcel Reutegger
>
> Benchmarking shows that the java.util.UUID.fromString() method is 10 times slower than the previous version we used from jackrabbit-jcr-commons. This method is quite heavily used in the query section or more generally whenever a NodeId is created from a String.
> I'd like to introduce the custom String UUID parsing code again that we had in the jackrabbit-jcr-commons UUID class and use it in the NodeId(String) constructor.
> WDYT?

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


[jira] Resolved: (JCR-2327) java.util.UUID.fromString() too slow

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

Thomas Mueller resolved JCR-2327.
---------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 2.0-beta3)
                   2.0-beta4

About 40% faster according to my test.

> java.util.UUID.fromString() too slow
> ------------------------------------
>
>                 Key: JCR-2327
>                 URL: https://issues.apache.org/jira/browse/JCR-2327
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Marcel Reutegger
>            Assignee: Thomas Mueller
>             Fix For: 2.0-beta4
>
>
> Benchmarking shows that the java.util.UUID.fromString() method is 10 times slower than the previous version we used from jackrabbit-jcr-commons. This method is quite heavily used in the query section or more generally whenever a NodeId is created from a String.
> I'd like to introduce the custom String UUID parsing code again that we had in the jackrabbit-jcr-commons UUID class and use it in the NodeId(String) constructor.
> WDYT?

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