commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Work logged] (TEXT-153) LookupTranslator performance optimization
Date Mon, 04 Mar 2019 22:23:00 GMT


ASF GitHub Bot logged work on TEXT-153:

                Author: ASF GitHub Bot
            Created on: 04/Mar/19 22:22
            Start Date: 04/Mar/19 22:22
    Worklog Time Spent: 10m 
      Work Description: garydgregory commented on issue #108: TEXT-153: Make prefixSet a BitSet.
   Don't forget to update `changes.xml` with your name in the `due-to` field.
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

Issue Time Tracking

    Worklog Id:     (was: 207469)
    Time Spent: 0.5h  (was: 20m)

> LookupTranslator performance optimization
> -----------------------------------------
>                 Key: TEXT-153
>                 URL:
>             Project: Commons Text
>          Issue Type: Improvement
>    Affects Versions: 1.0
>            Reporter: Amir Hadadi
>            Priority: Minor
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
> When using Java Mission Control to profile an application that uses StringEscapeUtils::escapeEcmaScript,
I noticed that a lot of time is spent in LookupTranslator::translate at the prefixSet::contains
> I suggest taking advantage of the fact that prefixSet contains only characters, and
replace it with a BitSet.
> I did some benchmarking and translate for the non escaped case is 4-5X faster when replacing
the HashSet with a BitSet.
> BitSet Memory consumption for characters is capped at 8KB, and depends on the maximal
prefix character. For example for ECMA script the max escaped prefix character is "\" which
has unicode code 92 so the BitSet uses a long array of length 2 to represent all the needed
> Link to pull request:

This message was sent by Atlassian JIRA

View raw message