From d99ff84c477926df7c5fb501181c907afebec287 Mon Sep 17 00:00:00 2001 From: MemRelay Date: Fri, 20 Nov 2026 23:04:30 +0800 Subject: [PATCH] =?UTF-8?q?create:=20=E5=90=8C=E6=97=B6=E8=A6=86=E7=9B=96?= =?UTF-8?q?=20Python/Go/Rust=20=E7=9A=84=E6=A1=8C=E9=9D=A2=20UI=20?= =?UTF-8?q?=E5=BA=93=E4=B8=8E=E5=AF=B9=E6=AF=94=E5=8F=A3=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MemRelay-Operation: memory-save:uiframe-mem-20261120-ui-compare MemRelay-Resource: 90117c3f-258a-4591-b60f-83127ce7d81e --- ... Python-Go-Rust 的桌面 UI 库与对比口径.md | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 projects/0017cd22-9dea-4f87-9595-fc050356ff3c/同时覆盖 Python-Go-Rust 的桌面 UI 库与对比口径.md diff --git a/projects/0017cd22-9dea-4f87-9595-fc050356ff3c/同时覆盖 Python-Go-Rust 的桌面 UI 库与对比口径.md b/projects/0017cd22-9dea-4f87-9595-fc050356ff3c/同时覆盖 Python-Go-Rust 的桌面 UI 库与对比口径.md new file mode 100644 index 0000000..f0f98c1 --- /dev/null +++ b/projects/0017cd22-9dea-4f87-9595-fc050356ff3c/同时覆盖 Python-Go-Rust 的桌面 UI 库与对比口径.md @@ -0,0 +1,42 @@ +--- +title: 同时覆盖 Python/Go/Rust 的桌面 UI 库与对比口径 +type: fact +permalink: main/projects/0017cd22-9dea-4f87-9595-fc050356ff3c/同时覆盖-python-go-rust-的桌面-ui-库与对比口径 +stable_id: 90117c3f-258a-4591-b60f-83127ce7d81e +scope: project +memory_type: fact +project_id: 0017cd22-9dea-4f87-9595-fc050356ff3c +usage_profile_id: 0c9feb46-d06e-43cd-9ef0-c5813c84a998 +status: active +revision: 1 +request_id: uiframe-mem-20261120-ui-compare +created_at: '2026-11-20T15:04:27.767453+00:00' +updated_at: '2026-11-20T15:04:27.767453+00:00' +tags: +- ui +- gtk +- qt +- fltk +- imgui +- performance +--- + +同时覆盖指同一套控件库在 Python、Go、Rust 都有仍可用的绑定。 + +常用四套: +- GTK 4:PyGObject;gotk4 0.4.1(2026-08,修闭包泄漏,许可 AGPL-3.0,GTK 本身 LGPL);gtk4-rs 0.11.5(2026-09)。 +- Qt 6:PySide6 官方;miqt 0.15.0(2026-10,Qt 6.12,MIT);Rust 官方 Qt Bridges 仍是技术预览,社区 cxx-qt 可用。therecipe/qt 已旧。 +- FLTK 1.4:pyfltk 1.4.5(2026-05);fltk-rs 1.5;go-fltk 覆盖 1.4,2026 发布日期未核到。静态链接后体积约 1 MB。 +- Dear ImGui:即时模式。cimgui-go 1.6.1(2026-10)跟到 ImGui 1.92.9;Python 有 imgui-bundle 等;Rust 有 imgui-rs,同期版本日期未核到。 +- Tk 也算:tkinter 最稳,控件能力有上限。 + +不算同时覆盖:Slint 1.19 官方有 Rust/C++/JS/Python,无官方 Go。Fyne、Gio 只有 Go。iced、egui 只有 Rust。Tauri/Wails/Electron 的界面是 HTML。 + +对比口径:不同场景的 PSS 与 RSS 不能相减。 +- Fedora 44 X11,2026-10,空窗口 smem:FLTK 1.4 静态 PSS 2.6 / USS 2.4 / RSS 13.0 MiB;Qt 6 Widgets 动态 PSS 17.7 / USS 9.2 / RSS 70.6 MiB。该次没有 GTK 4 和 ImGui。 +- macOS M1 16GB,2026-08,mizugeeks 同一套重界面峰值 RSS:四分割工作台 Slint 133、egui 155、Qt 174、GTK4 186、Electron 512、Wails 684、Tauri 739、Fyne 927 MiB。AI 辅助实现,只作趋势。FLTK 与 ImGui 未入测。egui 加载 CJK 字体约多 25 MiB。 +- 2019 年 Linux 私有内存(FLTK 1.7、GTK3 5、ImGui SDL 15.3、Qt 17 MB)是 GTK3/Qt5 时代,不能当成 GTK4/Qt6 现值。 + +结构性能耗:保留模式空闲 CPU 接近 0;Dear ImGui 默认按帧重绘。同一库上 Rust 接近 C/C++,Go 的 cgo 在高频回调才明显,Python 的差在解释器常驻和每帧逻辑。工具包基线差距大于 Go 与 Rust 之间的差距。 + +尚未选定项目要用哪一套。仓库仍是空目录。 \ No newline at end of file