perf: v3.26.170 诊断面板明细改为 60s 缓存 + 手动刷新(修面板开着时空闲 CPU 20%)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 2m47s
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 2m47s
This commit is contained in:
1 parent
30c9ef93be
commit
b0fd0a725c
5 files changed
+9
-6
No files matched your search
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "image-workbench-web",
|
||||
"private": true,
|
||||
"version": "3.26.169",
|
||||
"version": "3.26.170",
|
||||
"description": "Browser-based node canvas image workbench",
|
||||
"scripts": {
|
||||
"build": "node scripts/build.js && node scripts/copy-plugins.js",
|
||||
|
||||
Generated
+1
-1
@@ -2014,7 +2014,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "image-workbench"
|
||||
version = "3.26.167"
|
||||
version = "3.26.169"
|
||||
dependencies = [
|
||||
"arboard",
|
||||
"base64 0.22.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "image-workbench"
|
||||
version = "3.26.169"
|
||||
version = "3.26.170"
|
||||
description = "无限画布 · 生图工作台桌面版"
|
||||
authors = ["malongan"]
|
||||
license = ""
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
||||
"productName": "image-workbench",
|
||||
"version": "3.26.169",
|
||||
"version": "3.26.170",
|
||||
"identifier": "com.malongan.imageworkbench",
|
||||
"build": {
|
||||
"frontendDist": "../dist",
|
||||
|
||||
@@ -20,7 +20,10 @@
|
||||
function ensureDetail (ctx) {
|
||||
const now = Date.now()
|
||||
if (_detail.busy) return _detail.data
|
||||
if (_detail.data && now - _detail.at < 8000) return _detail.data
|
||||
// v3.26.170:8s → 60s。原来面板每 8 秒自动重扫(进程树 + 500+ 缩略图文件 + 插件目录),
|
||||
// 每扫一次就 setDiagRev 重渲染一次 —— 面板开着时表现为持续 20% CPU、堆锯齿、磁盘 0.1MB/s。
|
||||
// 现在只在第一次打开时取一次,之后靠「刷新」按钮手动更新。
|
||||
if (_detail.data && now - _detail.at < 60000) return _detail.data
|
||||
_detail.busy = true
|
||||
Promise.resolve(typeof ctx.onDiagDetail === 'function' ? ctx.onDiagDetail() : null).then((d) => {
|
||||
_detail = { at: Date.now(), data: d, busy: false }
|
||||
@@ -115,7 +118,7 @@
|
||||
el('div', { className: 'iwb-section-title' }, '运行诊断'),
|
||||
el('div', { className: 'iwb-hint' }, '用于排查「崩溃 / 内存占用高 / 界面出错」。记录只存在本机(localStorage),不含 Key、提示词和图片本体;进程/标签页意外结束后重开仍能看到崩溃前的记录。'),
|
||||
el('div', { className: 'iwb-row' },
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: () => { setDiagRev((v) => v + 1) } }, '刷新'),
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: () => { _detail.at = 0; _detail.data = null; setDiagRev((v) => v + 1) } }, '刷新'),
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', title: '复制完整诊断 JSON(含崩溃记录与内存采样)', onClick: copyDiag }, '复制诊断 JSON'),
|
||||
// v3.26.117:内存回收。只清可重建的缓存(撤销历史/缩略图/图片字节缓存)并把非活动画板降回引用形态,不删用户数据。
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', title: '立即回收内存:清撤销历史、缩略图缓存与图片字节缓存,非活动画板降回引用形态(不删任何画板/图片)', onClick: async () => { if (typeof reclaimMemory === 'function') await reclaimMemory() } }, '立即回收内存'),
|
||||
|
||||
Reference in new issue
Block a user