最近在开发一个 android r8 retrace 图形化应用
由于 android r8 只能在 jvm 上运行,故选择 compose multiplatform
使用 https://kmp.jetbrains.com/?android=true&ios=true&iosui=compose&includeTests=true 创建了一个 hello world 项目
没加依赖直接执行 createReleaseDistributable 构建 exe ,然后双击 exe ,等了 5s ,窗口出现
怀疑是本地 Windows11 的问题,把上面构建出来的打包为 zip 发给其它同事的电脑上运行测试,也是相同的结果
怀疑是构建配置问题,去下载知名开源项目,测试从点击 exe 至看到窗口耗时如何(中间没有 Windows 网络和安全拦截)
选了 https://github.com/topics/compose-multiplatform 排行靠前的应用
https://github.com/open-ani/animeko 耗时 7s 看到窗口
https://github.com/amir1376/ab-download-manager 耗时 3s 看到窗口
https://github.com/JetpackDuba/Gitnuro 耗时 6s 看到窗口
但是测试几年前应用 https://github.com/gaoyang5323/excel-search-by-compose-for-desktop 只耗时 1.5s 就看到界面,发送给同事测试也是一样短耗时
点击 vscode 图标 1s 就能看到窗口,compose multiplatform 的启动速度竟然不如 electron ?
1
magicls 8 天前
从这个帖子的“热度”我好像看到了 KMP 的采纳程度。
|
2
nilaoda 8 天前
试了一下,启动速度确实慢
|
3
lisongeee OP 感兴趣的可在 https://youtrack.jetbrains.com/issue/CMP-9429 查看详细问题报告
|
4
yukiww233 6 天前
试试看直接打包成 installer 安装后运行, 之前写过几个 compose multiplatform 的小玩意, 影响力没那么慢
单 exe 应该会把 jar 和整个 java runtime 解压到临时目录再运行吧? 可能是这个原因 |