mirror of
https://github.com/minio/minio.git
synced 2026-02-04 18:00:15 -05:00
Improve object reuse for grid messages (#18940)
Allow internal types to support a `Recycler` interface, which will allow for sharing of common types across handlers. This means that all `grid.MSS` (and similar) objects are shared across in a common pool instead of a per-handler pool. Add internal request reuse of internal types. Add for safe (pointerless) types explicitly. Only log params for internal types. Doing Sprint(obj) is just a bit too messy.
This commit is contained in:
@@ -346,6 +346,7 @@ func (client *storageRESTClient) StatVol(ctx context.Context, volume string) (vo
|
||||
return vol, toStorageErr(err)
|
||||
}
|
||||
vol = *v
|
||||
// Performs shallow copy, so we can reuse.
|
||||
storageStatVolHandler.PutResponse(v)
|
||||
return vol, nil
|
||||
}
|
||||
@@ -455,6 +456,7 @@ func (client *storageRESTClient) RenameData(ctx context.Context, srcVolume, srcP
|
||||
if err != nil {
|
||||
return 0, toStorageErr(err)
|
||||
}
|
||||
defer storageRenameDataHandler.PutResponse(resp)
|
||||
return resp.Signature, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user