Community
Participate
Working Groups
WI2 (112371): Reuse java.util.GregorianCalendar when converting from XSD_dateTime to millisecond times stamps. Note: This defect covers work item 2 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 java.util.GregorianCalendar object is created and configured in the EventHelpers#dateToLong(String) method for both the EMF and non-EMF Java Common Base Event implementations when converting from XSD_dateTime to millisecond times stamps. Also, this utility method may be revised to eliminate the need for assigning time stamp properties to local variable when they are only used once in the body of the method. 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 31228 [details] EventHelpersPerformancePatch.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=31228) [edit] > EventHelpersPerformancePatch.txt The creation of the java.util.GregorianCalendar object instance causes the costly resolution of the current run time locale. The proposed solution is to cache a static instance of the java.util.GregorianCalendar object for reuse by all callers when converting from XSD_dateTime to millisecond times stamps.
Correction: The updated method is the EventHelpers#longToDate(long) method for both the EMF and non-EMF Java Common Base Event implementations that converts from millisecond to XSD_dateTime times stamps.
The following classes and JUnit tests checked in to CVS (HEAD): org.eclipse.hyades.logging.core.tests\src\org\eclipse\hyades\logging\core\tests\junit\cbe\util\EventHelpersTest.java org.eclipse.hyades.logging.core.tests\src\org\eclipse\hyades\logging\core\tests\junit\cbe\emf\util\EventHelpersTest.java org.eclipse.hyades.logging.core\src.cbe101\org\eclipse\hyades\logging\events\cbe\util\EventHelpers.java org.eclipse.hyades.logging.core\src.events\org\eclipse\tptp\logging\events\cbe\util\EventHelpers.java
Verified in the TPTP-4.2.0-200604030200 TPTP V4.2.0 driver.