浏览代码

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

Daniel 1 年之前
父节点
当前提交
a63e1fda2e
共有 2 个文件被更改,包括 10 次插入18 次删除
  1. 5 9
      kernel/filesys/json_unmarshal.go
  2. 5 9
      kernel/filesys/json_unmarshal_windows_amd64.go

+ 5 - 9
kernel/filesys/json_unmarshal.go

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

+ 5 - 9
kernel/filesys/json_unmarshal_windows_amd64.go

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