lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-1472) DateTools.stringToDate() can cause lock contention under load
Date Tue, 02 Dec 2008 11:26:44 GMT

    [ https://issues.apache.org/jira/browse/LUCENE-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12652336#action_12652336
] 

Michael McCandless commented on LUCENE-1472:
--------------------------------------------

I agree: ThreadLocal, despite its problems, is probably the best solution here.  The memory
cost ought to be tiny.

We could also use CloseableThreadLocal (which works around the problems of ThreadLocal), and
then allow DateTools to be instantiated, and add a close() method to it (vs the all-static
methods we have today).  This way the application could close the DateTools instance and reliably
free up the tiny amount of memory used.

> 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: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message