0
0
bleve/search/collectors
Marty Schoch 60efecc8e9 cap preallocation by the collector to reasonable value
the collector has optimizations to avoid allocation and reslicing
during the common case of searching for top hits

however, in some cases users request an a very large number of
search hits to be returned (attempting to get them all)  this
caused unnecessary allocation of ram.

to address this we introduce a new constant PreAllocSizeSkipCap
it defaults the value of 1000.  if your search+skip is less than
this constant, you get the optimized behavior.  if your
search+skip is greater than this, we cap the preallcations to
this lower value.  additional space is acquired on an as needed
basis by growing the DocumentMatchPool and reslicing the
collector backing slice

applications can change the value of PreAllocSizeSkipCap to suit
their own needs

fixes #408
2016-08-31 15:25:17 -04:00
..
bench_test.go change collector benchmark to not reuse collector instances 2016-08-24 15:14:40 -04:00
heap.go refactored data structure out of collector 2016-08-26 10:29:50 -04:00
list.go refactored data structure out of collector 2016-08-26 10:29:50 -04:00
search_test.go improved implementation to address perf regressions 2016-08-25 15:47:07 -04:00
slice.go remove unneeded code 2016-08-26 17:27:19 -04:00
topn_test.go fix benchmark names to match values used 2016-08-26 18:09:03 -04:00
topn.go cap preallocation by the collector to reasonable value 2016-08-31 15:25:17 -04:00