commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <>
Subject [jira] Commented: (LANG-287) Optimize StringEscapeUtils.unescapeXml(String)
Date Tue, 06 Feb 2007 21:44:07 GMT


Henri Yandell commented on LANG-287:

LANG-102 was the issue in question that changed the code. There was lots of duplicate functionality
and we'd had bugs that had been fixed in one variant and not the other.

Using the current trunk and the current trunk with LANG-102 rolled back, I get the same numbers
for my previous (rewritten) test of 1,000 iterations of 100,000 length strings - one with
10,000 &gts and one without.

The new code is 10 times slower for the case of not having anything to escape.
It's about 10% faster for the case of having &gts to escape, dropping about half a second
below 10 seconds. So that's interesting.

Hopefully I can fix the first without hurting the second :)

> Optimize StringEscapeUtils.unescapeXml(String)
> ----------------------------------------------
>                 Key: LANG-287
>                 URL:
>             Project: Commons Lang
>          Issue Type: Improvement
>    Affects Versions: 2.2
>            Reporter: Stepan Koltsov
>            Priority: Minor
>             Fix For: 2.3
>         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.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message