[
https://issues.apache.org/jira/browse/LUCENE-7258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15260960#comment-15260960
]
Jeff Wartes commented on LUCENE-7258:
-------------------------------------
I'd be interested in trying TimSort, or something like [[email protected]]
suggested where an ExpandingIntArray-style array of arrays is fed directly into
the Radix sort, but I'm not sure I'm going to be able to commit much more time
to this for a bit.
That said, in the process of thinking about this, I do have a few git stashes
saved off with sketches for things like using TimSort and using
ExpandingIntArray that I could try to clean and post if anyone is interested.
I also have one sketch I started for using a loose pool mechanism to front
acquiring a FixedBitSet, but I didn't get deep enough to be able to tell with
confidence that a FBS was actually not being used anymore. Things like the
public FixedBitSet.getBits() method make it scary, although I'm convinced even
a very small pool of large FixedBitSets could be extremely advantageous. There
aren't that many in use at any given time, and a large FBS can still be used
for a small use-case. If anyone has some pointers around the lifecycle here,
I'd love to hear them.
> Tune DocIdSetBuilder allocation rate
> ------------------------------------
>
> Key: LUCENE-7258
> URL: https://issues.apache.org/jira/browse/LUCENE-7258
> Project: Lucene - Core
> Issue Type: Improvement
> Components: modules/spatial
> Reporter: Jeff Wartes
> Attachments:
> LUCENE-7258-Tune-memory-allocation-rate-for-Intersec.patch,
> LUCENE-7258-Tune-memory-allocation-rate-for-Intersec.patch,
> allocation_plot.jpg
>
>
> LUCENE-7211 converted IntersectsPrefixTreeQuery to use DocIdSetBuilder, but
> didn't actually reduce garbage generation for my Solr index.
> Since something like 40% of my garbage (by space) is now attributed to
> DocIdSetBuilder.growBuffer, I charted a few different allocation strategies
> to see if I could tune things more.
> See here: http://i.imgur.com/7sXLAYv.jpg
> The jump-then-flatline at the right would be where DocIdSetBuilder gives up
> and allocates a FixedBitSet for a 100M-doc index. (The 1M-doc index
> curve/cutoff looked similar)
> Perhaps unsurprisingly, the 1/8th growth factor in ArrayUtil.oversize is
> terrible from an allocation standpoint if you're doing a lot of expansions,
> and is especially terrible when used to build a short-lived data structure
> like this one.
> By the time it goes with the FBS, it's allocated around twice as much memory
> for the buffer as it would have needed for just the FBS.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]