[logback-dev] [JIRA] Commented: (LBCLASSIC-36) Synchronization of SimpleDateFormat object in DateConverter

Ceki Gulcu (JIRA) noreply-jira at qos.ch
Mon Jun 15 21:00:10 CEST 2009


    [ http://jira.qos.ch/browse/LBCLASSIC-36?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=11185#action_11185 ] 

Ceki Gulcu commented on LBCLASSIC-36:
-------------------------------------

In a threaded environment (16 threads) the overall throughput for SDF and JodaTime are very close.

=== DateFormatting ===
java.runtime.version = 1.6.0_05-b13
java.vendor          = Sun Microsystems Inc.
java.version         = 1.6.0_05
os.name              = Windows XP
os.version           = 5.1
JODA: total of 4810206 operations, or 1603 operations per millisecond
SDF:  total of 4685053 operations, or 1561 operations per millisecond

> Synchronization of SimpleDateFormat object in DateConverter
> -----------------------------------------------------------
>
>                 Key: LBCLASSIC-36
>                 URL: http://jira.qos.ch/browse/LBCLASSIC-36
>             Project: logback-classic
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: unspecified
>         Environment: Operating System: All
> Platform: All
>            Reporter: Anders Hammar
>            Assignee: Ceki Gulcu
>         Attachments: DateConverter_patch.java, DateFormatPerfTest.java, dateformattest.zip
>
>
> According to the API documentation of SimpleDateFormat, date formats are not synchronized and it is recommended to create separate format instances for each thread.
> However, a possibly simpler (mer efficient) solution would be to synchronize on the SimpleDateFormat object in the convert() method to prevent two threads to access it concurrently.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the logback-dev mailing list