Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MB-54131: Geoshape query decode optimization #1864

Merged
merged 8 commits into from Aug 31, 2023
16 changes: 15 additions & 1 deletion search/searcher/search_geoshape.go
Expand Up @@ -70,6 +70,20 @@
var dvShapeValue []byte
var startReading, finishReading bool
var reader *bytes.Reader

bufPool := make([][]byte, 11)
Likith101 marked this conversation as resolved.
Show resolved Hide resolved
bufPool[0] = make([]byte, 8192*3)
Likith101 marked this conversation as resolved.
Show resolved Hide resolved
bufPool[1] = make([]byte, 4096*3)
bufPool[2] = make([]byte, 2048*3)
bufPool[3] = make([]byte, 1024*3)
bufPool[4] = make([]byte, 512*3)
bufPool[5] = make([]byte, 256*3)
bufPool[6] = make([]byte, 128*3)
Likith101 marked this conversation as resolved.
Show resolved Hide resolved
bufPool[7] = make([]byte, 64*3)
bufPool[8] = make([]byte, 32*3)
bufPool[9] = make([]byte, 16*3)
bufPool[10] = make([]byte, 8*3)

return func(d *search.DocumentMatch) bool {
var found bool

Expand Down Expand Up @@ -104,7 +118,7 @@
// apply the filter once the entire docvalue is finished reading.
if finishReading {
v, err := geojson.FilterGeoShapesOnRelation(shape,
dvShapeValue, relation, &reader)
dvShapeValue, relation, &reader, &bufPool)

Check failure on line 121 in search/searcher/search_geoshape.go

View workflow job for this annotation

GitHub Actions / test (1.18.x, ubuntu-latest)

too many arguments in call to geojson.FilterGeoShapesOnRelation

Check failure on line 121 in search/searcher/search_geoshape.go

View workflow job for this annotation

GitHub Actions / test (1.18.x, macos-latest)

too many arguments in call to geojson.FilterGeoShapesOnRelation

Check failure on line 121 in search/searcher/search_geoshape.go

View workflow job for this annotation

GitHub Actions / test (1.19.x, ubuntu-latest)

too many arguments in call to geojson.FilterGeoShapesOnRelation

Check failure on line 121 in search/searcher/search_geoshape.go

View workflow job for this annotation

GitHub Actions / test (1.19.x, macos-latest)

too many arguments in call to geojson.FilterGeoShapesOnRelation

Check failure on line 121 in search/searcher/search_geoshape.go

View workflow job for this annotation

GitHub Actions / test (1.20.x, ubuntu-latest)

too many arguments in call to geojson.FilterGeoShapesOnRelation

Check failure on line 121 in search/searcher/search_geoshape.go

View workflow job for this annotation

GitHub Actions / test (1.20.x, macos-latest)

too many arguments in call to geojson.FilterGeoShapesOnRelation
if err == nil && v {
found = true
}
Expand Down