基于 GPU 的 Electron 瘦身
Muon 是 Electron 的轻量级替代品,用 Golang 编写,约 300 行代码,使用 Ultralight 而非 Chromium。Ultralight 是一个跨平台的 WebKit 重写版,利用 GPU 面向嵌入式桌面应用,从而提供快速、轻量且低内存的 HTML UI 解决方案,融合了 Chromium 的强大功能与原生 UI 的小巧体积。
与“Hello, World!” React 应用的对比
| Muon | Electron | |
|---|---|---|
| CPU | 0.0% | 1.2% |
| MEM | 26.0 MB | 201.7 MB |
| DISK | 42 MB | 136 MB |
来自 examples/create-React-app/main.go:
…Boolean 对应 Go:boolNumber 对应 Go:float64String 对应 Go:stringObject 对应 Go:通过 JSON 转换为 structgo build 或 go run 中添加 -ldflags -H=windowsgui 即可消除该窗口。exit status 3221225781 libWebCore.so: cannot open shared object file暂无开放 Issues,或尚未同步最近议题。