Skip to content

Commit

Permalink
Revert "Fix hack/benchmark search interface change (#2129)"
Browse files Browse the repository at this point in the history
This reverts commit 38d537f.
  • Loading branch information
ykadowak committed Nov 30, 2023
1 parent 112f528 commit 340b2eb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions hack/benchmark/core/benchmark/strategy/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func NewSearch(size int, epsilon, radius float32, opts ...StrategyOption) benchm
}
b.StartTimer()
defer b.StopTimer()
return c.Search(ctx, v.([]float32), size, epsilon, radius)
return c.Search(v.([]float32), size, epsilon, radius)
},
),
WithPreProp64(
Expand All @@ -59,7 +59,7 @@ func NewSearch(size int, epsilon, radius float32, opts ...StrategyOption) benchm
}
b.StartTimer()
defer b.StopTimer()
return c.Search(ctx, float32To64(v.([]float32)), size, epsilon, radius)
return c.Search(float32To64(v.([]float32)), size, epsilon, radius)
},
),
}, opts...)...)
Expand Down
6 changes: 2 additions & 4 deletions hack/benchmark/internal/core/algorithm/algorithm.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
// Package algorithm provides core interface
package algorithm

import "context"

type Mode uint32

const (
Expand All @@ -31,7 +29,7 @@ type Closer interface {
}

type Bit32 interface {
Search(ctx context.Context, vec []float32, size int, epsilon, radius float32) (interface{}, error)
Search(vec []float32, size int, epsilon, radius float32) (interface{}, error)
Insert(vec []float32) (uint, error)
InsertCommit(vec []float32, poolSize uint32) (uint, error)
BulkInsert(vecs [][]float32) ([]uint, []error)
Expand All @@ -46,7 +44,7 @@ type Bit32 interface {
}

type Bit64 interface {
Search(ctx context.Context, vec []float64, size int, epsilon, radius float32) (interface{}, error)
Search(vec []float64, size int, epsilon, radius float32) (interface{}, error)
Insert(vec []float64) (uint, error)
InsertCommit(vec []float64, poolSize uint32) (uint, error)
BulkInsert(vecs [][]float64) ([]uint, []error)
Expand Down
5 changes: 2 additions & 3 deletions hack/benchmark/internal/core/algorithm/ngt/ngt.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package ngt

import (
"context"
"os"

c "github.com/vdaas/vald/hack/benchmark/internal/core/algorithm"
Expand Down Expand Up @@ -75,8 +74,8 @@ func New(opts ...Option) (c.Bit32, error) {
return c, nil
}

func (c *core) Search(ctx context.Context, vec []float32, size int, epsilon, radius float32) (interface{}, error) {
return c.NGT.Search(ctx, vec, size, epsilon, radius)
func (c *core) Search(vec []float32, size int, epsilon, radius float32) (interface{}, error) {
return c.NGT.Search(vec, size, epsilon, radius)
}

func (c *core) Close() {
Expand Down

0 comments on commit 340b2eb

Please sign in to comment.