Community
Participate
Working Groups
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
Created attachment 31226 [details] XmlUtilityPerformancePatch.txt
P1 Cannot ship without this enhancement normal A problem making a function difficult to use but no special work around is required
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
Verified in the TPTP V4.2.0 (TPTP-4.2.0-200604030200) driver.