Nuno Santos created OAK-12414:
---------------------------------

             Summary: Simplify and pre-size list-record bucket construction in 
DefaultSegmentWriter
                 Key: OAK-12414
                 URL: https://issues.apache.org/jira/browse/OAK-12414
             Project: Jackrabbit Oak
          Issue Type: Improvement
          Components: segment-tar
            Reporter: Nuno Santos


{{DefaultSegmentWriter}}'s list-record writer builds each level of buckets via 
{{ListUtils.partitionList(thisLevel, ListRecord.LEVEL\_SIZE)}}, which 
materializes an intermediate sub-list per bucket, and appends the result to an 
unsized {{ArrayList}} for the next level.

Since the number of buckets per level is a simple ceiling division ({{(size + 
levelSize - 1) / levelSize}}), the next-level list can be pre-sized up front, 
and each bucket can be addressed directly via {{thisLevel.subList(i, end)}} 
over the current level instead of building it through 
{{ListUtils.partitionList}}.

No behavioral change intended.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to