commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LANG-287) Optimize StringEscapeUtils.unescapeXml(String)
Date Tue, 24 Oct 2006 20:29:18 GMT
    [ http://issues.apache.org/jira/browse/LANG-287?page=comments#action_12444492 ] 
            
Henri Yandell commented on LANG-287:
------------------------------------

Holger's suggestion does seem to happily resolve Gary's problem.

Under 1.5, with 1000 iterations of a 100,000 length String (no &s), things are optimised
from 10 seconds to a third of a second. So a good order of magnitude plus improvement there.

If I place 10,000 '&gt;'s in the 100,000 length String, the time remains at just over
10 seconds for both. So no noticeable change there.

> Optimize StringEscapeUtils.unescapeXml(String)
> ----------------------------------------------
>
>                 Key: LANG-287
>                 URL: http://issues.apache.org/jira/browse/LANG-287
>             Project: Commons Lang
>          Issue Type: Improvement
>    Affects Versions: 2.2
>            Reporter: Stepan Koltsov
>            Priority: Minor
>         Attachments: commons-lang-unescape-performace-stepancheg-2006-10-24.diff
>
>
> StringEscapeUtils.unescapeXml(String) (and other unescaes) works too slowly if String
has nothing to unescape, that is very common situation.
> To make unescape faster, following check should be added to be start of Entities.unescape(str)
> if (str.indexOf('&') < 0)
>     return str;

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


Mime
View raw message