use json unmarshal/marshal from jsoniter in hotpaths (#12269)

This commit is contained in:
Harshavardhana
2021-05-11 02:02:32 -07:00
committed by GitHub
parent 14849b9b2c
commit b81fada834
8 changed files with 16 additions and 4 deletions

View File

@@ -20,7 +20,6 @@ package cmd
import (
"bytes"
"context"
"encoding/json"
"net/http"
jsoniter "github.com/json-iterator/go"
@@ -41,6 +40,7 @@ const (
// storeDataUsageInBackend will store all objects sent on the gui channel until closed.
func storeDataUsageInBackend(ctx context.Context, objAPI ObjectLayer, dui <-chan madmin.DataUsageInfo) {
for dataUsageInfo := range dui {
var json = jsoniter.ConfigCompatibleWithStandardLibrary
dataUsageJSON, err := json.Marshal(dataUsageInfo)
if err != nil {
logger.LogIf(ctx, err)