mirror of
https://github.com/minio/minio.git
synced 2025-11-10 22:10:12 -05:00
performance: gjson parsing for readXLMeta, listParts, getObjectInfo. (#2631)
- Using gjson for constructing xlMetaV1{} in realXLMeta.
- Test for parsing constructing xlMetaV1{} using gjson.
- Changes made since benchmarks showed 30-40% improvement in speed.
- Follow up comments in issue https://github.com/minio/minio/issues/2208
for more details.
- gjson parsing of parts from xl.json for listParts.
- gjson parsing of statInfo from xl.json for getObjectInfo.
- Vendorizing gjson dependency.
This commit is contained in:
committed by
Harshavardhana
parent
66459a4ce0
commit
8bd78fbdfb
@@ -375,22 +375,23 @@ func (xl xlObjects) GetObjectInfo(bucket, object string) (ObjectInfo, error) {
|
||||
|
||||
// getObjectInfo - wrapper for reading object metadata and constructs ObjectInfo.
|
||||
func (xl xlObjects) getObjectInfo(bucket, object string) (objInfo ObjectInfo, err error) {
|
||||
var xlMeta xlMetaV1
|
||||
xlMeta, err = xl.readXLMetadata(bucket, object)
|
||||
// returns xl meta map and stat info.
|
||||
xlStat, xlMetaMap, err := xl.readXLMetaStat(bucket, object)
|
||||
if err != nil {
|
||||
// Return error.
|
||||
return ObjectInfo{}, err
|
||||
}
|
||||
|
||||
objInfo = ObjectInfo{
|
||||
IsDir: false,
|
||||
Bucket: bucket,
|
||||
Name: object,
|
||||
Size: xlMeta.Stat.Size,
|
||||
ModTime: xlMeta.Stat.ModTime,
|
||||
MD5Sum: xlMeta.Meta["md5Sum"],
|
||||
ContentType: xlMeta.Meta["content-type"],
|
||||
ContentEncoding: xlMeta.Meta["content-encoding"],
|
||||
UserDefined: xlMeta.Meta,
|
||||
Size: xlStat.Size,
|
||||
ModTime: xlStat.ModTime,
|
||||
MD5Sum: xlMetaMap["md5Sum"],
|
||||
ContentType: xlMetaMap["content-type"],
|
||||
ContentEncoding: xlMetaMap["content-encoding"],
|
||||
UserDefined: xlMetaMap,
|
||||
}
|
||||
return objInfo, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user