0
0
bleve/search/collectors
Marty Schoch c9310b906d introduced new collector store impl based on slice
counter-intuitively the list impl was faster than the heap
the theory was the heap did more comparisons and swapping
so even though it benefited from no interface and some cache
locality, it was still slower

the idea was to just use a raw slice kept in order
this avoids the need for interface, but can take same comparison
approach as the list

it seems to work out:

 go test -run=xxx -bench=. -benchmem -cpuprofile=cpu.out
BenchmarkTop10of100000Scores-4     	    5000	    299959 ns/op	    2600 B/op	      36 allocs/op
BenchmarkTop100of100000Scores-4    	    2000	    601104 ns/op	   20720 B/op	     216 allocs/op
BenchmarkTop10of1000000Scores-4    	     500	   3450196 ns/op	    2616 B/op	      36 allocs/op
BenchmarkTop100of1000000Scores-4   	     500	   3874276 ns/op	   20856 B/op	     216 allocs/op
PASS
ok  	github.com/blevesearch/bleve/search/collectors	7.440s
2016-08-26 11:52:49 -04:00
..
bench_test.go improved implementation to address perf regressions 2016-08-25 15:47:07 -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 introduced new collector store impl based on slice 2016-08-26 11:52:49 -04:00
topn_test.go refactored data structure out of collector 2016-08-26 10:29:50 -04:00
topn.go introduced new collector store impl based on slice 2016-08-26 11:52:49 -04:00