reduce all major allocations in replication path (#18032)

- remove targetClient for passing around via replicationObjectInfo{}
- remove cloing to object info unnecessarily
- remove objectInfo from replicationObjectInfo{} (only require necessary fields)
This commit is contained in:
Harshavardhana
2023-09-16 02:28:06 -07:00
committed by GitHub
parent 9fab91852a
commit fa6d082bfd
12 changed files with 373 additions and 238 deletions

View File

@@ -507,7 +507,10 @@ func (o *ObjectInfo) IsCompressedOK() (bool, error) {
}
// GetActualSize - returns the actual size of the stored object
func (o *ObjectInfo) GetActualSize() (int64, error) {
func (o ObjectInfo) GetActualSize() (int64, error) {
if o.ActualSize != nil {
return *o.ActualSize, nil
}
if o.IsCompressed() {
sizeStr, ok := o.UserDefined[ReservedMetadataPrefix+"actual-size"]
if !ok {