[jira] [Created] (LANG-715) CharSetUtils.squeeze() speedup

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (LANG-715) CharSetUtils.squeeze() speedup

Gary D. Gregory (Jira)
CharSetUtils.squeeze() speedup
------------------------------

                 Key: LANG-715
                 URL: https://issues.apache.org/jira/browse/LANG-715
             Project: Commons Lang
          Issue Type: Improvement
          Components: lang.*
    Affects Versions: 3.0
            Reporter: Ville Skyttä
            Priority: Minor
         Attachments: squeeze-speedup.patch

The attached patch speeds up CharSetUtils.squeeze() by avoiding unnecessary calls to CharSet.contains().  It should not slow down any cases, and in my tests with some use cases that I consider fairly common ones I got up to sixfold speedups with the patch.

It's not that squeeze() would be that slow in the first place before the patch; I just happened to be playing around with caliper (http://code.google.com/p/caliper/) and squeeze() was one of the first things I tried it with.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (LANG-715) CharSetUtils.squeeze() speedup

Gary D. Gregory (Jira)

     [ https://issues.apache.org/jira/browse/LANG-715?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ville Skyttä updated LANG-715:
------------------------------

    Attachment: squeeze-speedup.patch

CharSetUtils.squeeze() speedup

> CharSetUtils.squeeze() speedup
> ------------------------------
>
>                 Key: LANG-715
>                 URL: https://issues.apache.org/jira/browse/LANG-715
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>    Affects Versions: 3.0
>            Reporter: Ville Skyttä
>            Priority: Minor
>              Labels: patch
>         Attachments: squeeze-speedup.patch
>
>
> The attached patch speeds up CharSetUtils.squeeze() by avoiding unnecessary calls to CharSet.contains().  It should not slow down any cases, and in my tests with some use cases that I consider fairly common ones I got up to sixfold speedups with the patch.
> It's not that squeeze() would be that slow in the first place before the patch; I just happened to be playing around with caliper (http://code.google.com/p/caliper/) and squeeze() was one of the first things I tried it with.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply | Threaded
Open this post in threaded view
|

[jira] [Resolved] (LANG-715) CharSetUtils.squeeze() speedup

Gary D. Gregory (Jira)
In reply to this post by Gary D. Gregory (Jira)

     [ https://issues.apache.org/jira/browse/LANG-715?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary D. Gregory resolved LANG-715.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 3.0
         Assignee: Gary D. Gregory

Patch applied in slightly different fashion. Thank you! :)

> CharSetUtils.squeeze() speedup
> ------------------------------
>
>                 Key: LANG-715
>                 URL: https://issues.apache.org/jira/browse/LANG-715
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>    Affects Versions: 3.0
>            Reporter: Ville Skyttä
>            Assignee: Gary D. Gregory
>            Priority: Minor
>              Labels: patch
>             Fix For: 3.0
>
>         Attachments: squeeze-speedup.patch
>
>
> The attached patch speeds up CharSetUtils.squeeze() by avoiding unnecessary calls to CharSet.contains().  It should not slow down any cases, and in my tests with some use cases that I consider fairly common ones I got up to sixfold speedups with the patch.
> It's not that squeeze() would be that slow in the first place before the patch; I just happened to be playing around with caliper (http://code.google.com/p/caliper/) and squeeze() was one of the first things I tried it with.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira