-
Notifications
You must be signed in to change notification settings - Fork 52
Do not unmarshal API requests #4078
Copy link
Copy link
Open
Labels
I4No visible changesNo visible changesS3Minimally significantMinimally significantU4Nothing urgentNothing urgentenhancementImproving existing functionalityImproving existing functionalityneofs-storageStorage node application issuesStorage node application issuesperformanceMore of something per secondMore of something per second
Description
Activity
Metadata
Metadata
Assignees
Labels
I4No visible changesNo visible changesS3Minimally significantMinimally significantU4Nothing urgentNothing urgentenhancementImproving existing functionalityImproving existing functionalityneofs-storageStorage node application issuesStorage node application issuesperformanceMore of something per secondMore of something per second
Is your feature request related to a problem? Please describe.
efficiency of gRPC deserialization leaves much to be desired. We've optimized handling of response messages and gained visible performance impact
any request is a protobuf message. When server accepts API call, it:
neofs-node/pkg/services/object/server.go
Line 664 in 6180c09
so, we can make similar optimizations made for responses
Describe the solution you'd like
primitive data like CID/OID can be caught and left on stack. Structures like bearer token or object header can be transmitted in binary format. For example, we could save object header as BLOB. Or scan bearer token rules w/o allocs. Or, if new messages with same fields will be needed, we can make simple memcpy w/o extra decode-encode round
the code will definitely become more complicated. But we'll get rid of many allocations and increase RPS
it's easier to start with simpler queries like HEAD
Additional context
nspcc-dev/neofs-sdk-go#818