Community
Participate
Working Groups
WI1 (112371): Reuse org.xml.sax.XMLReader when de-serializing Common Base Event XML fragment/document. Note: This defect covers work item 1 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. Currently, a new org.xml.sax.XMLReader object is created and configured before a Common Base Event XML fragment/document is de-serialized using the EventFormatter class in both the EMF and non-EMF Java Common Base Event implementations. For example, the use case of importing a Common Base Event XML log file results in 88.5% of the total for de-serializing the Common Base Event XML log file. Specifically, creating the XML parser during de-serialization accounts for 26% of the total . Also, creating the XML reader during de-serialization accounts for 61% of the total . Finally, when the XML reader is created during de-serialization, a SAXParser is created and initialized accounting for 44% of the total . Although the test environment is using a JDK (e.g. IBM JDK) that ships the Xerces parser, some JDKs (e.g. Sun JDK v1.4.x) ships a proprietary XML Parser implementation (e.g. Crimson) which often deviates from the XML Parser specification. For example, although the XML Parser specification specifies that "once a parse is complete, an application may reuse the same org.xml.sax.XMLReader object, possibly with a different input source", the TPTP and EMF Teams have found this not to be entirely correct for all XML Parser implementations. As such, we have opted to create a new instances of the org.xml.sax.XMLReader and org.eclipse.hyades.logging.events.cbe.util.SAXEventHandler on each invocation of the org.eclipse.hyades.logging.events.cbe.util.associationEnginesFromCanonicalXMLDoc () and org.eclipse.hyades.logging.events.cbe.util.eventsFromCanonicalXMLDoc() methods. The proposed fix (see attach) contains the overhead of synchronizing each call to the above static methods as well as the memory consumption of a static lock object. 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. Sizing (PW): Design: 0.25 Code: 0.25 Test: 0.5 Documentation: 0.0 ------------------- Total: 1.0
Created attachment 31227 [details] EventFormatterPerformancePatch.txt
P1 Cannot ship without this enhancement normal A problem making a function difficult to use but no special work around is required
(In reply to comment #1) > Created an attachment (id=31227) [edit] > EventFormatterPerformancePatch.txt The proposed solution is to cache a static instance of the org.xml.sax.XMLReader object for reuse by all callers when de-serializing Common Base Event XML fragment(s)/document(s).
The following classes have been checked in to HEAD (Hyades): org.eclipse.hyades.logging.core: org.eclipse.hyades.logging.events.cbe.util.EventFormatter.java org.eclipse.hyades.logging.events.cbe.util.tests.EventFormatterTest.java The following classes have been checked in to HEAD (TPTP), TPTP-4_0_1 and TPTP-4_1_0: org.eclipse.hyades.logging.core: org.eclipse.hyades.logging.events.cbe.util.EventFormatter.java org.eclipse.tptp.logging.events.cbe.util.EventFormatter.java org.eclipse.hyades.logging.core.tests: org.eclipse.hyades.logging.core.junit.cbe.util.EventFormatterTest.java org.eclipse.hyades.logging.core.junit.cbe.emf.util.EventFormatterTest.java The above JUnit tests have been executed (Windows) using the following JREs: IBM V1.4.0 IBM V1.4.2 IBM V1.5.0 Sun V1.4.0 Sun V1.4.1 Sun V1.4.2
Verified in CVS.
(In reply to comment #5) > Verified in CVS. HEAD (TPTP)
Hi Paul, has this fix been put into the TPTP 3.3.0.2 fix pack?
(In reply to comment #7) > Hi Paul, has this fix been put into the TPTP 3.3.0.2 fix pack? Yes since TPTP V3.3.0.2 is a patch release of Hyades (HEAD) (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=119461#c4).
Oh, I see. So HEAD (Hyades) is for the TPTP 3.3 stream. Thanks!