Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-3105

String.intern() calls slow down IndexWriter.close() and IndexReader.open() for index with large number of unique field names

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 3.1
    • None
    • core/index
    • None
    • New, Patch Available

    Description

      We have one index with several hundred thousand unqiue field names (we're optimistic that Lucene 4.0 is flexible enough to allow us to change our index design...) and found that opening an index writer and closing an index reader results in horribly slow performance on that one index. I have isolated the problem down to the calls to String.intern() that are used to allow for quick string comparisons of field names throughout Lucene. These String.intern() calls are unnecessary and can be replaced with a hashmap lookup. In fact, StringHelper.java has its own hashmap implementation that it uses in conjunction with String.intern(). Rather than using a one-off hashmap, I've elected to use a ConcurrentHashMap in this patch.

      Attachments

        1. LUCENE-3105.patch
          1 kB
          Mark Kristensson

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mkristensson Mark Kristensson
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: