[
https://issues.apache.org/jira/browse/LUCENE-1607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12700618#action_12700618
]
Yonik Seeley commented on LUCENE-1607:
--------------------------------------
The thread safety problem has to do with safe object publication (making an
object visible to a different thread). Mutable objects generally can't be
safely published w/o synchronization.... it has to do with CPU caches in
multi-CPU systems.
IIRC, current x86 architectures will see fewer problems since read barriers are
no-ops.. caches are guaranteed to be coherent. But even on x86, you aren't
guaranteed that instructions and writes won't be reordered... so the
assignment to pool could be visible *before* all the memory changes that
newPool.put() could cause.
> String.intern() faster alternative
> ----------------------------------
>
> Key: LUCENE-1607
> URL: https://issues.apache.org/jira/browse/LUCENE-1607
> Project: Lucene - Java
> Issue Type: Improvement
> Reporter: Earwin Burrfoot
> Fix For: 2.9
>
> Attachments: intern.patch, LUCENE-1607.patch
>
>
> By using our own interned string pool on top of default, String.intern() can
> be greatly optimized.
> On my setup (java 6) this alternative runs ~15.8x faster for already interned
> strings, and ~2.2x faster for 'new String(interned)'
> For java 5 and 4 speedup is lower, but still considerable.
--
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]