commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fabian Lange (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LANG-935) Possible performance improvement on string escape functions
Date Fri, 13 Mar 2015 10:58:38 GMT

    [ https://issues.apache.org/jira/browse/LANG-935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14360201#comment-14360201
] 

Fabian Lange commented on LANG-935:
-----------------------------------

I have run the benchmarks, Its not how I would write them today, but they are ok.
The problem with the patch is that it is not a patch. Its a completely different approach
to escaping.

However I checked against my PR https://github.com/apache/commons-lang/pull/49 for LANG-877
and i noticed about a 20% performance improvement on your benchmark, so thats ok now.

I will investigate a bit more if I can speed it up, but I would not want to take your code
(for license and conceptual issues)

> Possible performance improvement on string escape functions
> -----------------------------------------------------------
>
>                 Key: LANG-935
>                 URL: https://issues.apache.org/jira/browse/LANG-935
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.text.translate.*
>    Affects Versions: 3.1
>            Reporter: Peter Wall
>            Priority: Minor
>              Labels: performance
>             Fix For: Patch Needed
>
>         Attachments: tempproject1.zip
>
>
> The escape functions for HTML etc. use the same code and the same initialisation tables
for the escape and unescape functions, and while this is an elegant approach it leads to a
number of deficiencies:
> 1. The code is very much less efficient than it could be
> 2. A new output string is created even when no conversion is required
> 3. No mapping is provided for characters that do not have a specific representation (for
example HTML 0x101 should become &amp;#257; )
> The proposal is to use a new mapping technique to address these issues



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message