Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 119467 - WI3 (112371): Eliminate appending single characters to java.lang.StringBuffer in denormalize() and normalize() methods.
Summary: WI3 (112371): Eliminate appending single characters to java.lang.StringBuffer...
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: TPTP (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P1 normal (vote)
Target Milestone: ---   Edit
Assignee: Paul Slauenwhite CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 112371
  Show dependency tree
 
Reported: 2005-12-06 14:12 EST by Paul Slauenwhite CLA
Modified: 2016-05-05 10:49 EDT (History)
2 users (show)

See Also:


Attachments
XmlUtilityPerformancePatch.txt (6.54 KB, text/plain)
2005-12-06 14:17 EST, Paul Slauenwhite CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Slauenwhite CLA 2005-12-06 14:12:41 EST
WI3 (112371): Eliminate appending single characters to java.lang.StringBuffer in denormalize() and normalize() methods.

Note: This defect covers work item 3 of enhancement #112371
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=112371) for performance and memory 
improvements for the three producer Common Base Event implementations.

The org.eclipse.hyades.logging.core.XmlUtility#normalize(String) and org.eclipse.hyades.logging.core.XmlUtility#denormalize(String)
methods iterate the parameter string searching for either markup characters or entity references to normalize or 
denormalize, respectively.  Currently, these methods iterate the parameter String per character while buffering 
traversed characters.  Since the java.lang.StringBuffer#append(char) method is costly and is called O(n) on every invocation of
these methods, eliminate appending single characters in favor of buffering blocks of characters that do not require normalization or 
denormalization.

Ultimately, more investigation is needed to determine the residual side affects of the 
proposed fix (see attach) and possibly the design and implementation of an alternative fix 
to achieve similar performance benefits without the high risk of a functional breakage in 
certain run-times and time zones. 


Sizing (PW):
 
Design:        0.25 
Code:          0.25 
Test:          0.5 
Documentation: 0.0
-------------------
Total:         1.0
Comment 1 Paul Slauenwhite CLA 2005-12-06 14:17:46 EST
Created attachment 31226 [details]
XmlUtilityPerformancePatch.txt
Comment 2 Paul Slauenwhite CLA 2005-12-06 14:20:55 EST
P1 Cannot ship without this enhancement 
normal A problem making a function difficult to use but no special work around 
is required
Comment 3 Paul Slauenwhite CLA 2006-03-30 10:40:22 EST
Checked the following class and JUnit test in CVS (HEAD):

org.eclipse.hyades.logging.core\src\org\eclipse\hyades\logging\core\XmlUtility.java

org.eclipse.hyades.logging.core.tests\src\org\eclipse\hyades\logging\core\tests\junit\core\XmlUtilityTest.java
Comment 4 Paul Slauenwhite CLA 2006-04-03 12:24:52 EDT
Verified in the TPTP V4.2.0 (TPTP-4.2.0-200604030200) driver.