diff --git a/kernel/filesys/json_unmarshal.go b/kernel/filesys/json_unmarshal.go index 339ce6512..b01ab495a 100644 --- a/kernel/filesys/json_unmarshal.go +++ b/kernel/filesys/json_unmarshal.go @@ -14,8 +14,6 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -//go:build !amd64 - package filesys import ( @@ -23,10 +21,5 @@ import ( ) func unmarshalJSON(data []byte, v interface{}) error { - //now := time.Now() - //defer func() { - // elapsed := time.Since(now) - // logging.LogInfof("[go-json] unmarshalJSON took %s", elapsed) - //}() return json.Unmarshal(data, v) } diff --git a/kernel/filesys/json_unmarshal_amd64.go b/kernel/filesys/json_unmarshal_amd64.go deleted file mode 100644 index 52983fc85..000000000 --- a/kernel/filesys/json_unmarshal_amd64.go +++ /dev/null @@ -1,39 +0,0 @@ -// SiYuan - Refactor your thinking -// Copyright (c) 2020-present, b3log.org -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package filesys - -import ( - "github.com/bytedance/sonic" - "github.com/goccy/go-json" - "github.com/siyuan-note/logging" -) - -func unmarshalJSON(data []byte, v interface{}) (err error) { - //now := time.Now() - defer func() { - if e := recover(); nil != e { - logging.LogWarnf("[sonic] unmarshalJSON failed: %s", e) - err = json.Unmarshal(data, v) - } /*else { - elapsed := time.Since(now) - logging.LogInfof("[sonic] unmarshalJSON took %s", elapsed) - }*/ - }() - - err = sonic.Unmarshal(data, v) - return -} diff --git a/kernel/go.mod b/kernel/go.mod index bd9996a04..1453f91ed 100644 --- a/kernel/go.mod +++ b/kernel/go.mod @@ -17,7 +17,6 @@ require ( github.com/PuerkitoBio/goquery v1.8.1 github.com/Xuanwo/go-locale v1.1.0 github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de - github.com/bytedance/sonic v1.10.0 github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be github.com/denisbrodbeck/machineid v1.0.1 github.com/dgraph-io/ristretto v0.1.1 @@ -78,6 +77,7 @@ require ( github.com/andybalholm/cascadia v1.3.2 // indirect github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef // indirect github.com/aws/aws-sdk-go v1.45.2 // indirect + github.com/bytedance/sonic v1.10.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect github.com/chenzhuoyu/iasm v0.9.0 // indirect