You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Adam Heath (JIRA)" <ji...@apache.org> on 2007/05/14 17:41:16 UTC

[jira] Created: (VFS-160) Speedup FileNameParser.encodeCharacter

Speedup FileNameParser.encodeCharacter
--------------------------------------

                 Key: VFS-160
                 URL: https://issues.apache.org/jira/browse/VFS-160
             Project: Commons VFS
          Issue Type: Improvement
            Reporter: Adam Heath
         Attachments: feature_array-based-encodeCharacter.patch

Use an array for characters < 256, and a BitSet for those larger.  Speedup improvement.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Commented: (VFS-160) Speedup FileNameParser.encodeCharacter

Posted by "Adam Heath (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12495732 ] 

Adam Heath commented on VFS-160:
--------------------------------

Method call overhead showed up in a profiling run, in high-volume repeated calls.  It's not enough to compare *just* this method, but when you have several layered files, and the name is parsed at each level, the overhead does add up.

It's the chained methods(super.encodeCharacter), and the chained comparisons, in the worst case, that show the slowdown.  When a character doesn't need to be encoded, the parents are all called, and each comparison in each child then has to fail, before it finally returns.

The patch reduces all that to a single array index, then a call to the BitSet.  The time is now constant, no matter how many characters have to be encoded.  Before, the time was not constant, as some characters would take longer to check whether they needed to be encoded, because more super.encodeCharacter calls would be invoked.

> Speedup FileNameParser.encodeCharacter
> --------------------------------------
>
>                 Key: VFS-160
>                 URL: https://issues.apache.org/jira/browse/VFS-160
>             Project: Commons VFS
>          Issue Type: Improvement
>    Affects Versions: 1.1
>            Reporter: Adam Heath
>            Priority: Minor
>         Attachments: feature_array-based-encodeCharacter.patch
>
>
> Use an array for characters < 256, and a BitSet for those larger.  Speedup improvement.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Updated: (VFS-160) Speedup FileNameParser.encodeCharacter

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

Adam Heath updated VFS-160:
---------------------------

             Priority: Minor  (was: Major)
    Affects Version/s: 1.1

> Speedup FileNameParser.encodeCharacter
> --------------------------------------
>
>                 Key: VFS-160
>                 URL: https://issues.apache.org/jira/browse/VFS-160
>             Project: Commons VFS
>          Issue Type: Improvement
>    Affects Versions: 1.1
>            Reporter: Adam Heath
>            Priority: Minor
>         Attachments: feature_array-based-encodeCharacter.patch
>
>
> Use an array for characters < 256, and a BitSet for those larger.  Speedup improvement.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Commented: (VFS-160) Speedup FileNameParser.encodeCharacter

Posted by "Mario Ivankovits (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12495702 ] 

Mario Ivankovits commented on VFS-160:
--------------------------------------

Could you explain a little bit why this would be a speedup improvement?

I don't think that our character comparison is really slower than the array access stuff.

> Speedup FileNameParser.encodeCharacter
> --------------------------------------
>
>                 Key: VFS-160
>                 URL: https://issues.apache.org/jira/browse/VFS-160
>             Project: Commons VFS
>          Issue Type: Improvement
>    Affects Versions: 1.1
>            Reporter: Adam Heath
>            Priority: Minor
>         Attachments: feature_array-based-encodeCharacter.patch
>
>
> Use an array for characters < 256, and a BitSet for those larger.  Speedup improvement.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Updated: (VFS-160) Speedup FileNameParser.encodeCharacter

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

Adam Heath updated VFS-160:
---------------------------

    Attachment: feature_array-based-encodeCharacter.patch

Against svn 501759.

> Speedup FileNameParser.encodeCharacter
> --------------------------------------
>
>                 Key: VFS-160
>                 URL: https://issues.apache.org/jira/browse/VFS-160
>             Project: Commons VFS
>          Issue Type: Improvement
>    Affects Versions: 1.1
>            Reporter: Adam Heath
>            Priority: Minor
>         Attachments: feature_array-based-encodeCharacter.patch
>
>
> Use an array for characters < 256, and a BitSet for those larger.  Speedup improvement.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org