mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
⚡ Improve block loading performance on Windows/Linux/macOS amd64 arch https://github.com/siyuan-note/siyuan/issues/9084
This commit is contained in:
parent
a54ddd5c8e
commit
a63e1fda2e
2 changed files with 10 additions and 18 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue