Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 346123

Summary: [Performance] Improve EncodingUtil escapeXXX methods
Product: [RT] RAP Reporter: Ralf Sternberg <rsternberg>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3 CC: tbuschto
Version: 1.4   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

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.