Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 346123 - [Performance] Improve EncodingUtil escapeXXX methods
Summary: [Performance] Improve EncodingUtil escapeXXX methods
Status: RESOLVED WONTFIX
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.4   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-17 12:44 EDT by Ralf Sternberg CLA
Modified: 2012-01-20 06:11 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Sternberg CLA 2011-05-17 12:44:34 EDT
There are several method to escape or replace certain patterns in text in RWT, such as:
* EncodingUtil#escapeXXX, #replaceNewlines, etc.
* WidgetLCAUtil#escapeText

When more than one of these methods are called for the same input, the string is looped over again and again. By combining those methods we copying the string repeatedly could be avoided.
More ideas for optimization:
- initialize size of string buffers
- check for occurrences of the pattern beforehand
Comment 1 Tim Buschtoens CLA 2012-01-20 05:33:03 EST
EncodingUtil has been ported to the client, and the Java version is rarely used anymore. Does this make this bug obsolete?
Comment 2 Ralf Sternberg CLA 2012-01-20 06:11:59 EST
Right, we do not have to optimize these methods anymore since they're only used in the compatibility layer.