🔥 Revert Improve block loading performance on Windows/Linux/macOS amd64 arch Fix https://github.com/siyuan-note/siyuan/issues/9131

This commit is contained in:
Daniel 2023-09-07 11:29:36 +08:00
parent 1373d3d10b
commit 7cd20f9999
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 1 additions and 47 deletions

View file

@ -14,8 +14,6 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//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)
}

View file

@ -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 <https://www.gnu.org/licenses/>.
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
}

View file

@ -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