From 0987f5bbdbb5de6ea37acf1af229d0f3f6ce7572 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Wed, 6 Sep 2023 17:18:19 +0800 Subject: [PATCH 1/2] :art: Update text --- app/appearance/langs/en_US.json | 4 +++- app/appearance/langs/es_ES.json | 4 +++- app/appearance/langs/fr_FR.json | 4 +++- app/appearance/langs/zh_CHT.json | 4 +++- app/appearance/langs/zh_CN.json | 4 +++- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/app/appearance/langs/en_US.json b/app/appearance/langs/en_US.json index 64ec37cb8b6..2df53e98145 100644 --- a/app/appearance/langs/en_US.json +++ b/app/appearance/langs/en_US.json @@ -1039,7 +1039,9 @@ "task.history.database.index.commit": "Execute history database index commit", "task.database.index.embedBlock": "Execute database index embed block", "task.reload.ui": "Execute reload UI", - "task.upgrade.userGuide": "Execute upgrade user guide" + "task.upgrade.userGuide": "Execute upgrade user guide", + "task.asset.database.index.full": "Execute asset database rebuild index", + "task.asset.database.index.commit": "Execute asset database index commit" }, "_trayMenu": { "showWindow": "Show Window", diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.json index cdaa2745ce3..5ca8740f8ff 100644 --- a/app/appearance/langs/es_ES.json +++ b/app/appearance/langs/es_ES.json @@ -1039,7 +1039,9 @@ "task.history.database.index.commit": "Ejecutar la confirmación del índice de la base de datos del historial", "task.database.index.embedBlock": "Ejecutar bloque de incrustación de índice de base de datos", "task.reload.ui": "IU de recarga de tareas", - "task.upgrade.userGuide": "Ejecutar la guía de usuario de actualización" + "task.upgrade.userGuide": "Ejecutar la guía de usuario de actualización", + "task.asset.database.index.full": "Ejecutar índice de reconstrucción de base de datos de activos", + "task.asset.database.index.commit": "Ejecutar confirmación del índice de la base de datos de activos" }, "_trayMenu": { "showWindow": "Mostrar ventana", diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.json index 6c98b30a0aa..a7d805b41ca 100644 --- a/app/appearance/langs/fr_FR.json +++ b/app/appearance/langs/fr_FR.json @@ -1039,7 +1039,9 @@ "task.history.database.index.commit": "Effectuer la validation de l'index de la base de données d'historique", "task.database.index.embedBlock": "Exécuter le bloc d'intégration d'index de base de données", "task.reload.ui": "Interface utilisateur de rechargement de tâche", - "task.upgrade.userGuide": "Mise à niveau de la tâche de guide utilisateur" + "task.upgrade.userGuide": "Mise à niveau de la tâche de guide utilisateur", + "task.asset.database.index.full": "Exécuter l'index de reconstruction de la base de données d'actifs", + "task.asset.database.index.commit": "Exécuter la validation de l'index de la base de données des actifs" }, "_trayMenu": { "showWindow": "Afficher la fenêtre principale", diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.json index 7e479db78fd..1b6a1090db4 100644 --- a/app/appearance/langs/zh_CHT.json +++ b/app/appearance/langs/zh_CHT.json @@ -1039,7 +1039,9 @@ "task.history.database.index.commit": "執行歷史資料庫索引提交", "task.database.index.embedBlock": "執行資料庫索引嵌入塊", "task.reload.ui": "執行重載界面", - "task.upgrade.userGuide": "執行升級用戶指南" + "task.upgrade.userGuide": "執行升級用戶指南", + "task.asset.database.index.full": "執行資源文件數據庫重建索引", + "task.asset.database.index.commit": "執行資源文件數據庫索引提交" }, "_trayMenu": { "showWindow": "顯示主窗口", diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.json index df9a02882e3..aecb0817859 100644 --- a/app/appearance/langs/zh_CN.json +++ b/app/appearance/langs/zh_CN.json @@ -1039,7 +1039,9 @@ "task.history.database.index.commit": "执行历史数据库索引提交", "task.database.index.embedBlock": "执行数据库索引嵌入块", "task.reload.ui": "执行重载界面", - "task.upgrade.userGuide": "执行升级用户指南" + "task.upgrade.userGuide": "执行升级用户指南", + "task.asset.database.index.full": "执行资源文件数据库重建索引", + "task.asset.database.index.commit": "执行资源文件数据库索引提交" }, "_trayMenu": { "showWindow": "显示主窗口", From 4eca8c43e60a585b5d02decf20124efa3dce6a98 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Wed, 6 Sep 2023 17:19:38 +0800 Subject: [PATCH 2/2] :zap: Improve block loading performance on Windows/Linux/macOS amd64 arch https://github.com/siyuan-note/siyuan/issues/9084 --- kernel/filesys/json_unmarshal.go | 2 +- ...ndows_amd64.go => json_unmarshal_amd64.go} | 21 +++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) rename kernel/filesys/{json_unmarshal_windows_amd64.go => json_unmarshal_amd64.go} (66%) diff --git a/kernel/filesys/json_unmarshal.go b/kernel/filesys/json_unmarshal.go index 44235db52e1..339ce65124c 100644 --- a/kernel/filesys/json_unmarshal.go +++ b/kernel/filesys/json_unmarshal.go @@ -14,7 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -//go:build !(windows && amd64) +//go:build !amd64 package filesys diff --git a/kernel/filesys/json_unmarshal_windows_amd64.go b/kernel/filesys/json_unmarshal_amd64.go similarity index 66% rename from kernel/filesys/json_unmarshal_windows_amd64.go rename to kernel/filesys/json_unmarshal_amd64.go index dcf58e9db94..52983fc8541 100644 --- a/kernel/filesys/json_unmarshal_windows_amd64.go +++ b/kernel/filesys/json_unmarshal_amd64.go @@ -18,13 +18,22 @@ package filesys import ( "github.com/bytedance/sonic" + "github.com/goccy/go-json" + "github.com/siyuan-note/logging" ) -func unmarshalJSON(data []byte, v interface{}) error { +func unmarshalJSON(data []byte, v interface{}) (err error) { //now := time.Now() - //defer func() { - // elapsed := time.Since(now) - // logging.LogInfof("[sonic] unmarshalJSON took %s", elapsed) - //}() - return sonic.Unmarshal(data, v) + 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 }