Skip to content

Commit

Permalink
[bugfix] disable vtproto pooling due to the performance degradation (#…
Browse files Browse the repository at this point in the history
…2063)

Signed-off-by: kpango <[email protected]>
  • Loading branch information
kpango authored Jun 15, 2023
1 parent 02927a3 commit 407e6f5
Show file tree
Hide file tree
Showing 38 changed files with 5,862 additions and 4,794 deletions.
23 changes: 12 additions & 11 deletions Makefile.d/functions.mk
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,20 @@ define proto-code-gen
$(PROTO_PATHS:%=-I %) \
--go_out=$(GOPATH)/src --plugin protoc-gen-go="$(GOPATH)/bin/protoc-gen-go" \
--go-vtproto_out=$(GOPATH)/src --plugin protoc-gen-go-vtproto="$(GOPATH)/bin/protoc-gen-go-vtproto" \
--go-vtproto_opt=pool=$(ROOTDIR)/apis/proto/v1/payload.Insert.MultiRequest \
--go-vtproto_opt=pool=$(ROOTDIR)/apis/proto/v1/payload.Insert.Request \
--go-vtproto_opt=pool=$(ROOTDIR)/apis/proto/v1/payload.Object.Vector \
--go-vtproto_opt=pool=$(ROOTDIR)/apis/proto/v1/payload.Object.Vectors \
--go-vtproto_opt=pool=$(ROOTDIR)/apis/proto/v1/payload.Search.ObjectRequest \
--go-vtproto_opt=pool=$(ROOTDIR)/apis/proto/v1/payload.Search.Request \
--go-vtproto_opt=pool=$(ROOTDIR)/apis/proto/v1/payload.Update.MultiRequest \
--go-vtproto_opt=pool=$(ROOTDIR)/apis/proto/v1/payload.Update.Request \
--go-vtproto_opt=pool=$(ROOTDIR)/apis/proto/v1/payload.Upsert.MultiRequest \
--go-vtproto_opt=pool=$(ROOTDIR)/apis/proto/v1/payload.Upsert.Request \
--go-vtproto_opt=features=pool+grpc+marshal+unmarshal+size+equal \
--go-vtproto_opt=features=grpc+marshal+unmarshal+size+equal+clone \
$1
endef
# --go-vtproto_opt=pool=$(ROOTDIR)/apis/proto/v1/payload.Object.Vector \
# --go-vtproto_opt=pool=$(ROOTDIR)/apis/proto/v1/payload.Insert.MultiRequest \
# --go-vtproto_opt=pool=$(ROOTDIR)/apis/proto/v1/payload.Insert.Request \
# --go-vtproto_opt=pool=$(ROOTDIR)/apis/proto/v1/payload.Object.Vector \
# --go-vtproto_opt=pool=$(ROOTDIR)/apis/proto/v1/payload.Object.Vectors \
# --go-vtproto_opt=pool=$(ROOTDIR)/apis/proto/v1/payload.Search.ObjectRequest \
# --go-vtproto_opt=pool=$(ROOTDIR)/apis/proto/v1/payload.Search.Request \
# --go-vtproto_opt=pool=$(ROOTDIR)/apis/proto/v1/payload.Update.MultiRequest \
# --go-vtproto_opt=pool=$(ROOTDIR)/apis/proto/v1/payload.Update.Request \
# --go-vtproto_opt=pool=$(ROOTDIR)/apis/proto/v1/payload.Upsert.MultiRequest \
# --go-vtproto_opt=pool=$(ROOTDIR)/apis/proto/v1/payload.Upsert.Request \
define protoc-gen
protoc \
Expand Down
40 changes: 20 additions & 20 deletions apis/docs/v1/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@

- [Search.AggregationAlgorithm](#payload-v1-Search-AggregationAlgorithm)

- [apis/proto/v1/vald/upsert.proto](#apis_proto_v1_vald_upsert-proto)
- [Upsert](#vald-v1-Upsert)
- [apis/proto/v1/vald/filter.proto](#apis_proto_v1_vald_filter-proto)
- [Filter](#vald-v1-Filter)
- [apis/proto/v1/vald/insert.proto](#apis_proto_v1_vald_insert-proto)
Expand All @@ -104,6 +102,8 @@
- [Search](#vald-v1-Search)
- [apis/proto/v1/vald/update.proto](#apis_proto_v1_vald_update-proto)
- [Update](#vald-v1-Update)
- [apis/proto/v1/vald/upsert.proto](#apis_proto_v1_vald_upsert-proto)
- [Upsert](#vald-v1-Upsert)
- [Scalar Value Types](#scalar-value-types)

<a name="apis_proto_v1_agent_core_agent-proto"></a>
Expand Down Expand Up @@ -930,24 +930,6 @@ AggregationAlgorithm is enum of each aggregation algorithms
| SortPoolSlice | 3 | |
| PairingHeap | 4 | |

<a name="apis_proto_v1_vald_upsert-proto"></a>

<p align="right"><a href="#top">Top</a></p>

## apis/proto/v1/vald/upsert.proto

<a name="vald-v1-Upsert"></a>

### Upsert

Upsert service provides ways to insert/update vectors.

| Method Name | Request Type | Response Type | Description |
| ------------ | ------------------------------------------------------------------ | ----------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| Upsert | [.payload.v1.Upsert.Request](#payload-v1-Upsert-Request) | [.payload.v1.Object.Location](#payload-v1-Object-Location) | A method to insert/update a vector. |
| StreamUpsert | [.payload.v1.Upsert.Request](#payload-v1-Upsert-Request) stream | [.payload.v1.Object.StreamLocation](#payload-v1-Object-StreamLocation) stream | A method to insert/update multiple vectors by bidirectional streaming. |
| MultiUpsert | [.payload.v1.Upsert.MultiRequest](#payload-v1-Upsert-MultiRequest) | [.payload.v1.Object.Locations](#payload-v1-Object-Locations) | A method to insert/update multiple vectors in a single request. |

<a name="apis_proto_v1_vald_filter-proto"></a>

<p align="right"><a href="#top">Top</a></p>
Expand Down Expand Up @@ -1074,6 +1056,24 @@ Update service provides ways to update indexed vectors.
| StreamUpdate | [.payload.v1.Update.Request](#payload-v1-Update-Request) stream | [.payload.v1.Object.StreamLocation](#payload-v1-Object-StreamLocation) stream | A method to update multiple indexed vectors by bidirectional streaming. |
| MultiUpdate | [.payload.v1.Update.MultiRequest](#payload-v1-Update-MultiRequest) | [.payload.v1.Object.Locations](#payload-v1-Object-Locations) | A method to update multiple indexed vectors in a single request. |

<a name="apis_proto_v1_vald_upsert-proto"></a>

<p align="right"><a href="#top">Top</a></p>

## apis/proto/v1/vald/upsert.proto

<a name="vald-v1-Upsert"></a>

### Upsert

Upsert service provides ways to insert/update vectors.

| Method Name | Request Type | Response Type | Description |
| ------------ | ------------------------------------------------------------------ | ----------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| Upsert | [.payload.v1.Upsert.Request](#payload-v1-Upsert-Request) | [.payload.v1.Object.Location](#payload-v1-Object-Location) | A method to insert/update a vector. |
| StreamUpsert | [.payload.v1.Upsert.Request](#payload-v1-Upsert-Request) stream | [.payload.v1.Object.StreamLocation](#payload-v1-Object-StreamLocation) stream | A method to insert/update multiple vectors by bidirectional streaming. |
| MultiUpsert | [.payload.v1.Upsert.MultiRequest](#payload-v1-Upsert-MultiRequest) | [.payload.v1.Object.Locations](#payload-v1-Object-Locations) | A method to insert/update multiple vectors in a single request. |

## Scalar Value Types

| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby |
Expand Down
6 changes: 3 additions & 3 deletions apis/grpc/v1/agent/core/agent_vtproto.pb.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (c *agentClient) CreateAndSaveIndex(ctx context.Context, in *payload.Contro
}

func (c *agentClient) IndexInfo(ctx context.Context, in *payload.Empty, opts ...grpc.CallOption) (*payload.Info_Index_Count, error) {
out := payload.Info_Index_CountFromVTPool()
out := new(payload.Info_Index_Count)
err := c.cc.Invoke(ctx, "/core.v1.Agent/IndexInfo", in, out, opts...)
if err != nil {
return nil, err
Expand Down Expand Up @@ -141,7 +141,7 @@ func RegisterAgentServer(s grpc.ServiceRegistrar, srv AgentServer) {
}

func _Agent_CreateIndex_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := payload.Control_CreateIndexRequestFromVTPool()
in := new(payload.Control_CreateIndexRequest)
if err := dec(in); err != nil {
return nil, err
}
Expand Down Expand Up @@ -177,7 +177,7 @@ func _Agent_SaveIndex_Handler(srv interface{}, ctx context.Context, dec func(int
}

func _Agent_CreateAndSaveIndex_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := payload.Control_CreateIndexRequestFromVTPool()
in := new(payload.Control_CreateIndexRequest)
if err := dec(in); err != nil {
return nil, err
}
Expand Down
8 changes: 4 additions & 4 deletions apis/grpc/v1/discoverer/discoverer_vtproto.pb.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func NewDiscovererClient(cc grpc.ClientConnInterface) DiscovererClient {
}

func (c *discovererClient) Pods(ctx context.Context, in *payload.Discoverer_Request, opts ...grpc.CallOption) (*payload.Info_Pods, error) {
out := payload.Info_PodsFromVTPool()
out := new(payload.Info_Pods)
err := c.cc.Invoke(ctx, "/discoverer.v1.Discoverer/Pods", in, out, opts...)
if err != nil {
return nil, err
Expand All @@ -66,7 +66,7 @@ func (c *discovererClient) Pods(ctx context.Context, in *payload.Discoverer_Requ
}

func (c *discovererClient) Nodes(ctx context.Context, in *payload.Discoverer_Request, opts ...grpc.CallOption) (*payload.Info_Nodes, error) {
out := payload.Info_NodesFromVTPool()
out := new(payload.Info_Nodes)
err := c.cc.Invoke(ctx, "/discoverer.v1.Discoverer/Nodes", in, out, opts...)
if err != nil {
return nil, err
Expand Down Expand Up @@ -109,7 +109,7 @@ func RegisterDiscovererServer(s grpc.ServiceRegistrar, srv DiscovererServer) {
}

func _Discoverer_Pods_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := payload.Discoverer_RequestFromVTPool()
in := new(payload.Discoverer_Request)
if err := dec(in); err != nil {
return nil, err
}
Expand All @@ -127,7 +127,7 @@ func _Discoverer_Pods_Handler(srv interface{}, ctx context.Context, dec func(int
}

func _Discoverer_Nodes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := payload.Discoverer_RequestFromVTPool()
in := new(payload.Discoverer_Request)
if err := dec(in); err != nil {
return nil, err
}
Expand Down
8 changes: 4 additions & 4 deletions apis/grpc/v1/filter/egress/egress_filter_vtproto.pb.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func NewFilterClient(cc grpc.ClientConnInterface) FilterClient {
}

func (c *filterClient) FilterDistance(ctx context.Context, in *payload.Object_Distance, opts ...grpc.CallOption) (*payload.Object_Distance, error) {
out := payload.Object_DistanceFromVTPool()
out := new(payload.Object_Distance)
err := c.cc.Invoke(ctx, "/filter.egress.v1.Filter/FilterDistance", in, out, opts...)
if err != nil {
return nil, err
Expand All @@ -66,7 +66,7 @@ func (c *filterClient) FilterDistance(ctx context.Context, in *payload.Object_Di
}

func (c *filterClient) FilterVector(ctx context.Context, in *payload.Object_Vector, opts ...grpc.CallOption) (*payload.Object_Vector, error) {
out := payload.Object_VectorFromVTPool()
out := new(payload.Object_Vector)
err := c.cc.Invoke(ctx, "/filter.egress.v1.Filter/FilterVector", in, out, opts...)
if err != nil {
return nil, err
Expand Down Expand Up @@ -109,7 +109,7 @@ func RegisterFilterServer(s grpc.ServiceRegistrar, srv FilterServer) {
}

func _Filter_FilterDistance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := payload.Object_DistanceFromVTPool()
in := new(payload.Object_Distance)
if err := dec(in); err != nil {
return nil, err
}
Expand All @@ -127,7 +127,7 @@ func _Filter_FilterDistance_Handler(srv interface{}, ctx context.Context, dec fu
}

func _Filter_FilterVector_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := payload.Object_VectorFromVTPool()
in := new(payload.Object_Vector)
if err := dec(in); err != nil {
return nil, err
}
Expand Down
8 changes: 4 additions & 4 deletions apis/grpc/v1/filter/ingress/ingress_filter_vtproto.pb.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func NewFilterClient(cc grpc.ClientConnInterface) FilterClient {
}

func (c *filterClient) GenVector(ctx context.Context, in *payload.Object_Blob, opts ...grpc.CallOption) (*payload.Object_Vector, error) {
out := payload.Object_VectorFromVTPool()
out := new(payload.Object_Vector)
err := c.cc.Invoke(ctx, "/filter.ingress.v1.Filter/GenVector", in, out, opts...)
if err != nil {
return nil, err
Expand All @@ -66,7 +66,7 @@ func (c *filterClient) GenVector(ctx context.Context, in *payload.Object_Blob, o
}

func (c *filterClient) FilterVector(ctx context.Context, in *payload.Object_Vector, opts ...grpc.CallOption) (*payload.Object_Vector, error) {
out := payload.Object_VectorFromVTPool()
out := new(payload.Object_Vector)
err := c.cc.Invoke(ctx, "/filter.ingress.v1.Filter/FilterVector", in, out, opts...)
if err != nil {
return nil, err
Expand Down Expand Up @@ -109,7 +109,7 @@ func RegisterFilterServer(s grpc.ServiceRegistrar, srv FilterServer) {
}

func _Filter_GenVector_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := payload.Object_BlobFromVTPool()
in := new(payload.Object_Blob)
if err := dec(in); err != nil {
return nil, err
}
Expand All @@ -127,7 +127,7 @@ func _Filter_GenVector_Handler(srv interface{}, ctx context.Context, dec func(in
}

func _Filter_FilterVector_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := payload.Object_VectorFromVTPool()
in := new(payload.Object_Vector)
if err := dec(in); err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion apis/grpc/v1/manager/index/index_manager_vtproto.pb.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func NewIndexClient(cc grpc.ClientConnInterface) IndexClient {
}

func (c *indexClient) IndexInfo(ctx context.Context, in *payload.Empty, opts ...grpc.CallOption) (*payload.Info_Index_Count, error) {
out := payload.Info_Index_CountFromVTPool()
out := new(payload.Info_Index_Count)
err := c.cc.Invoke(ctx, "/manager.index.v1.Index/IndexInfo", in, out, opts...)
if err != nil {
return nil, err
Expand Down
Loading

0 comments on commit 407e6f5

Please sign in to comment.