Skip to content

Optimize allocations in HEAD proxy#3877

Draft
cthulhu-rider wants to merge 10 commits intomasterfrom
head-proxy-bin
Draft

Optimize allocations in HEAD proxy#3877
cthulhu-rider wants to merge 10 commits intomasterfrom
head-proxy-bin

Conversation

@cthulhu-rider
Copy link
Copy Markdown
Contributor

No description provided.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 16, 2026

Codecov Report

❌ Patch coverage is 16.82135% with 717 lines in your changes missing coverage. Please review.
✅ Project coverage is 26.66%. Comparing base (60d685f) to head (ad75c99).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
pkg/services/object/get.go 0.00% 215 Missing ⚠️
internal/protobuf/buffers.go 0.00% 106 Missing ⚠️
internal/protobuf/parsers.go 30.20% 104 Missing ⚠️
internal/protobuf/protoscan/scan.go 0.00% 98 Missing ⚠️
internal/protobuf/protoscan/scheme.go 0.00% 75 Missing ⚠️
pkg/services/object/server.go 38.57% 42 Missing and 1 partial ⚠️
pkg/services/object/head.go 63.82% 20 Missing and 14 partials ⚠️
internal/protobuf/codecs.go 0.00% 14 Missing ⚠️
internal/protobuf/protoscan/messages.go 0.00% 13 Missing ⚠️
pkg/services/object/get/util.go 0.00% 7 Missing ⚠️
... and 2 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3877      +/-   ##
==========================================
- Coverage   26.78%   26.66%   -0.13%     
==========================================
  Files         677      682       +5     
  Lines       44616    45370     +754     
==========================================
+ Hits        11952    12097     +145     
- Misses      31553    32147     +594     
- Partials     1111     1126      +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cthulhu-rider cthulhu-rider force-pushed the head-proxy-bin branch 7 times, most recently from d86d087 to 3f4842f Compare March 30, 2026 15:10
Previously, SN decoded another SN's response into intermediate
structures and then re-encoded the response from them. This led to
unnecessary allocations and processing delays.

Now same response buffer is reused to respond to the client.

Refs #3898.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
This makes HEAD server to not unmarshal `protoobject.HeadResponse`
structure from protobuf but iterate over its fields. Only `body` and
`meta_header` fields are handled specifically, others are just verified
(keeping forward compatibility). Both body and meta header are still
unmarshalled for now. In the future they can be optimized the same.

Refs #3898.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
This makes HEAD server to not unmarshal `protosession.ResponseMetaHeader`
structure from protobuf but iterate over its fields. Only `code` field
is handled specifically, others are just verified (keeping forward
compatibility).

Refs #3898.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
This makes HEAD server to not unmarshal `protoobject.HeadResponse_Body`
structure from protobuf but iterate over its fields. Both header and
split info fields are still unmarshalled for now. In the future they can
be optimized the same.

Refs #3898.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
This makes HEAD server to not unmarshal
`protoobject.HeadResponse_Body_SplitInfo` structure from protobuf but
iterate over its fields.

Refs #3898.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Prepare for optimizations.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
This makes HEAD server to not unmarshal
`protoobject.HeaderWithSignature` structure from protobuf but iterate
over its fields.

Refs #3898.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant