Reduce the memory used by load disk index (#20475)

Signed-off-by: xige-16 <xi.ge@zilliz.com>

Signed-off-by: xige-16 <xi.ge@zilliz.com>
pull/20727/head
xige-16 2022-11-21 19:35:11 +08:00 committed by GitHub
parent 67403fcb3b
commit 1ad702cc40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 8 deletions

View File

@ -373,7 +373,7 @@ common:
SearchListSize: 100
PQCodeBudgetGBRatio: 0.125
BuildNumThreadsRatio: 1.0
SearchCacheBudgetGBRatio: 0.125
SearchCacheBudgetGBRatio: 0.10
LoadNumThreadRatio: 8.0
BeamWidthRatio: 4.0
# This parameter specify how many times the number of threads is the number of cores

View File

@ -35,7 +35,7 @@ const (
BeamWidthRatioKey = "beamwidth_ratio"
DefaultPQCodeBudgetGBRatio = 0.125
DefaultBuildNumThreadsRatio = 1.0
DefaultSearchCacheBudgetGBRatio = 0.125
DefaultSearchCacheBudgetGBRatio = 0.10
DefaultLoadNumThreadRatio = 8.0
DefaultBeamWidthRatio = 4.0
)

View File

@ -53,7 +53,7 @@ func TestBigDataIndex_parse(t *testing.T) {
assert.Equal(t, 1.0, extraParams.BuildNumThreadsRatio)
assert.Equal(t, 8.0, extraParams.LoadNumThreadRatio)
assert.Equal(t, 0.125, extraParams.PQCodeBudgetGBRatio)
assert.Equal(t, 0.125, extraParams.SearchCacheBudgetGBRatio)
assert.Equal(t, 0.10, extraParams.SearchCacheBudgetGBRatio)
})
t.Run("parse with nil", func(t *testing.T) {
@ -62,7 +62,7 @@ func TestBigDataIndex_parse(t *testing.T) {
assert.Equal(t, 1.0, extraParams.BuildNumThreadsRatio)
assert.Equal(t, 8.0, extraParams.LoadNumThreadRatio)
assert.Equal(t, 0.125, extraParams.PQCodeBudgetGBRatio)
assert.Equal(t, 0.125, extraParams.SearchCacheBudgetGBRatio)
assert.Equal(t, 0.10, extraParams.SearchCacheBudgetGBRatio)
})
t.Run("new from json normal", func(t *testing.T) {
@ -93,7 +93,7 @@ func TestBigDataIndex_parse(t *testing.T) {
assert.Equal(t, 1.0, extraParams.BuildNumThreadsRatio)
assert.Equal(t, 8.0, extraParams.LoadNumThreadRatio)
assert.Equal(t, 0.125, extraParams.PQCodeBudgetGBRatio)
assert.Equal(t, 0.125, extraParams.SearchCacheBudgetGBRatio)
assert.Equal(t, 0.10, extraParams.SearchCacheBudgetGBRatio)
assert.Equal(t, 4.0, extraParams.BeamWidthRatio)
})
@ -107,7 +107,7 @@ func TestBigDataIndex_parse(t *testing.T) {
assert.Equal(t, 1.0, extraParams.BuildNumThreadsRatio)
assert.Equal(t, 8.0, extraParams.LoadNumThreadRatio)
assert.Equal(t, 0.125, extraParams.PQCodeBudgetGBRatio)
assert.Equal(t, 0.125, extraParams.SearchCacheBudgetGBRatio)
assert.Equal(t, 0.10, extraParams.SearchCacheBudgetGBRatio)
assert.Equal(t, 4.0, extraParams.BeamWidthRatio)
})

View File

@ -45,7 +45,7 @@ func TestDiskIndexParams(t *testing.T) {
searchCacheBudgetGBRatio, err := strconv.ParseFloat(indexParams[SearchCacheBudgetRatioKey], 64)
assert.NoError(t, err)
assert.Equal(t, 0.125, searchCacheBudgetGBRatio)
assert.Equal(t, 0.10, searchCacheBudgetGBRatio)
loadNumThreadRatio, err := strconv.ParseFloat(indexParams[NumLoadThreadRatioKey], 64)
assert.NoError(t, err)

View File

@ -43,7 +43,7 @@ const (
DefaultSearchListSize = 100
DefaultPQCodeBudgetGBRatio = 0.125
DefaultBuildNumThreadsRatio = 1.0
DefaultSearchCacheBudgetGBRatio = 0.125
DefaultSearchCacheBudgetGBRatio = 0.10
DefaultLoadNumThreadRatio = 8.0
DefaultBeamWidthRatio = 4.0
)