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

This commit is contained in:
Daniel
2023-09-01 11:09:39 +08:00
parent a54ddd5c8e
commit a63e1fda2e
2 changed files with 10 additions and 18 deletions

View File

@@ -19,18 +19,14 @@
package filesys
import (
"time"
"github.com/goccy/go-json"
"github.com/siyuan-note/logging"
)
func unmarshalJSON(data []byte, v interface{}) error {
now := time.Now()
defer func() {
elapsed := time.Since(now)
logging.LogInfof("[go-json] unmarshalJSON took %s", elapsed)
}()
//now := time.Now()
//defer func() {
// elapsed := time.Since(now)
// logging.LogInfof("[go-json] unmarshalJSON took %s", elapsed)
//}()
return json.Unmarshal(data, v)
}

View File

@@ -17,18 +17,14 @@
package filesys
import (
"time"
"github.com/bytedance/sonic"
"github.com/siyuan-note/logging"
)
func unmarshalJSON(data []byte, v interface{}) error {
now := time.Now()
defer func() {
elapsed := time.Since(now)
logging.LogInfof("[sonic] unmarshalJSON took %s", elapsed)
}()
//now := time.Now()
//defer func() {
// elapsed := time.Since(now)
// logging.LogInfof("[sonic] unmarshalJSON took %s", elapsed)
//}()
return sonic.Unmarshal(data, v)
}