You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cthulhu-rider opened this issue
Dec 11, 2024
· 2 comments
Labels
blockedCan't be done because of somethingclientIssue related to the clientenhancementImproving existing functionalityI4No visible changesS2Regular significanceU4Nothing urgent
to sign any request, client selects an arbitrary buffer from the pool. If this buffer has sufficient size to encode the signed request parts, they are written into it. Otherwise, temp buffer of needed size is allocated for each part via make
i see following drawbacks of this approach:
buffers of different size are mixed in the pool. Some signed entities are empty (like NetmapService request bodies), some are pretty small <=1K (meta headers, bodies of almost all requests), some can be up to 4M (object PUT payload chunks)
make-allocated buffers aint pooled
2 just does not allow reusing the buffer. 1 may worsen caching in some cases:
when next 4M object payload chunk is to-be-signed, we are likely to select small buffer which leads . At the same time, pool can still have big buffers from previous chunks
when small entity is signed, it can acquire big buffer, however, most of its len will not be used. This also affects 1
Describe the solution you'd like
use size-based buffer pool. Size of any signed part is known in advance. We can precalc it and select the buffer of the closest size
if buffer is dynamically allocated for signing anyway, pool it
also wanna mention that when verifying responses, the buffers are always dynamic. They can also be pooled. This deserves a separate issue, but i suggest to create it only if current one is unblocked
blockedCan't be done because of somethingclientIssue related to the clientenhancementImproving existing functionalityI4No visible changesS2Regular significanceU4Nothing urgent
Is your feature request related to a problem? Please describe.
Client
allows to specify buffer pool for signing defaulting toneofs-sdk-go/client/client.go
Lines 96 to 105 in b312ddb
to sign any request, client selects an arbitrary buffer from the pool. If this buffer has sufficient size to encode the signed request parts, they are written into it. Otherwise, temp buffer of needed size is allocated for each part via
make
i see following drawbacks of this approach:
make
-allocated buffers aint pooled2 just does not allow reusing the buffer. 1 may worsen caching in some cases:
Describe the solution you'd like
Describe alternatives you've considered
no except keep as it is
Additional context
The text was updated successfully, but these errors were encountered: