lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Busch (JIRA)" <>
Subject [jira] Created: (LUCENE-739) Performance improvement for SegmentMerger.mergeNorms()
Date Thu, 07 Dec 2006 17:12:21 GMT
Performance improvement for SegmentMerger.mergeNorms()

                 Key: LUCENE-739
             Project: Lucene - Java
          Issue Type: Improvement
          Components: Index
            Reporter: Michael Busch
         Assigned To: Michael Busch
            Priority: Minor
         Attachments: mergeNorms.patch

This patch makes two improvements to SegmentMerger.mergeNorms():

1) When the SegmentMerger merges the norm values it allocates a new byte array to buffer the
values for every field of every segment. The size of such an array equals the size of the
corresponding segment, so if large segments are being merged, those arrays become very large,
We can easily reduce the number of array allocations by reusing a byte array to buffer the
norm values that only grows, if a segment is larger than the previous one.

2) Before a norm value is written it is checked if the corresponding document is deleted.
If not, the norm is written using IndexOutput.writeByte(byte[]). This patch introduces an
optimized case for segments that do not have any deleted docs. In this case the frequent call
of IndexReader.isDeleted(int) can be avoided and the more efficient method IndexOutput.writeBytes(byte[],
int) can be used.

This patch only changes the method SegmentMerger.mergeNorms(). All unit tests pass.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message