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

Use parallel arrays instead of PostingList objects


    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.1, 4.0-ALPHA
    • Component/s: core/index
    • Labels:
    • Lucene Fields:


      This is Mike's idea that was discussed in LUCENE-2293 and LUCENE-2324.

      In order to avoid having very many long-living PostingList objects in TermsHashPerField we want to switch to parallel arrays. The termsHash will simply be a int[] which maps each term to dense termIDs.

      All data that the PostingList classes currently hold will then we placed in parallel arrays, where the termID is the index into the arrays. This will avoid the need for object pooling, will remove the overhead of object initialization and garbage collection. Especially garbage collection should benefit significantly when the JVM runs out of memory, because in such a situation the gc mark times can get very long if there is a big number of long-living objects in memory.

      Another benefit could be to build more efficient TermVectors. We could avoid the need of having to store the term string per document in the TermVector. Instead we could just store the segment-wide termIDs. This would reduce the size and also make it easier to implement efficient algorithms that use TermVectors, because no term mapping across documents in a segment would be necessary. Though this improvement we can make with a separate jira issue.


        1. lucene-2329-2.patch
          11 kB
          Michael Busch
        2. LUCENE-2329.patch
          11 kB
          Michael McCandless
        3. LUCENE-2329.patch
          21 kB
          Michael McCandless
        4. LUCENE-2329.patch
          9 kB
          Michael McCandless
        5. LUCENE-2329.patch
          9 kB
          Michael McCandless
        6. lucene-2329.patch
          48 kB
          Michael Busch
        7. lucene-2329.patch
          49 kB
          Michael Busch
        8. lucene-2329.patch
          48 kB
          Michael Busch



            • Assignee:
              michaelbusch Michael Busch
              michaelbusch Michael Busch
            • Votes:
              0 Vote for this issue
              1 Start watching this issue


              • Created: