chore: add startup timing diagnostics for #270

Add [STARTUP] timing logs to Rust setup (plugin registration, storage
open, migration) and Vue frontend (onMounted, initFromStorage,
initFromDisk) to help diagnose slow startup reported in #270.
This commit is contained in:
t8y2
2026-05-14 19:35:34 +08:00
parent c37caeba78
commit ecb878315c
2 changed files with 22 additions and 2 deletions
+10 -1
View File
@@ -466,10 +466,16 @@ function onLoginSuccess() {
}
function initApp() {
const t0 = performance.now();
console.log("[STARTUP] initApp begin");
savedSqlStore
.initFromStorage()
.then(() => connectionStore.initFromDisk())
.then(() => {
console.log(`[STARTUP] savedSqlStore.initFromStorage: ${(performance.now() - t0).toFixed(0)}ms`);
return connectionStore.initFromDisk();
})
.then(() => {
console.log(`[STARTUP] connectionStore.initFromDisk: ${(performance.now() - t0).toFixed(0)}ms`);
reconnectRestoredTabs();
})
.catch((e: any) => {
@@ -501,6 +507,8 @@ function handleContextMenu(e: MouseEvent) {
}
onMounted(async () => {
console.log("[STARTUP] onMounted begin");
const mountStart = performance.now();
applyTheme();
window.addEventListener("keydown", handleKeydown, true);
if (isDesktop) {
@@ -541,6 +549,7 @@ onMounted(async () => {
})
.catch(() => {});
setupTauriListeners();
console.log(`[STARTUP] onMounted sync done: ${(performance.now() - mountStart).toFixed(0)}ms`);
});
onUnmounted(() => {