Use jsoniter to improve performance
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
package fullpage
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"io/ioutil"
|
||||
"sort"
|
||||
|
||||
@ -9,6 +8,7 @@ import (
|
||||
"github.com/animenotifier/arn"
|
||||
"github.com/animenotifier/notify.moe/components"
|
||||
"github.com/animenotifier/notify.moe/utils"
|
||||
jsoniter "github.com/json-iterator/go"
|
||||
)
|
||||
|
||||
var organization map[string]interface{}
|
||||
@ -17,8 +17,8 @@ var organizationString string
|
||||
func init() {
|
||||
// Load structured data
|
||||
organizationBytes, _ := ioutil.ReadFile("organization.json")
|
||||
json.Unmarshal(organizationBytes, &organization)
|
||||
organizationBytes, _ = json.Marshal(organization)
|
||||
jsoniter.Unmarshal(organizationBytes, &organization)
|
||||
organizationBytes, _ = jsoniter.Marshal(organization)
|
||||
organizationString = string(organizationBytes)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user