[ https://issues.apache.org/jira/browse/LUCENE-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12652220#action_12652220 ]
robert engels commented on LUCENE-1472: --------------------------------------- If you review the source for SimpleDateFormat you will see that it internally performs some synchronization during initialization anyway (uses some Hashtables), and also that the initialization cost is pretty high (lots of code), so a static sync'd copy is probably best. Outside of that, the ThreadLocal is the way to go. My tests shows that the instantiation time is 2x longer than the typical parse time. > DateTools.stringToDate() can cause lock contention under load > ------------------------------------------------------------- > > Key: LUCENE-1472 > URL: https://issues.apache.org/jira/browse/LUCENE-1472 > Project: Lucene - Java > Issue Type: Improvement > Components: Search > Affects Versions: 2.3.2 > Reporter: Mark Lassau > Priority: Minor > > Load testing our application (the JIRA Issue Tracker) has shown that threads > spend a lot of time blocked in DateTools.stringToDate(). > The stringToDate() method uses a singleton SimpleDateFormat object to parse > the dates. > Each call to SimpleDateFormat.parse() is *synchronized* because > SimpleDateFormat is not thread safe. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]