lisongeee
V2EX  ›  Android

compose multiplatform 的 hello world 项目从双击 exe 至窗口可见竟然耗时 5s

  •  
  •   lisongeee · Dec 15, 2025 · 2366 views
    This topic created in 161 days ago, the information mentioned may be changed or developed.

    最近在开发一个 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 ?

    5 replies    2025-12-18 13:53:07 +08:00
    magicls
        1
    magicls  
       Dec 16, 2025
    从这个帖子的“热度”我好像看到了 KMP 的采纳程度。
    nilaoda
        2
    nilaoda  
       Dec 16, 2025
    试了一下,启动速度确实慢
    lisongeee
        3
    lisongeee  
    OP
       Dec 17, 2025   ❤️ 1
    感兴趣的可在 https://youtrack.jetbrains.com/issue/CMP-9429 查看详细问题报告
    yukiww233
        4
    yukiww233  
       Dec 18, 2025
    试试看直接打包成 installer 安装后运行, 之前写过几个 compose multiplatform 的小玩意, 影响力没那么慢
    单 exe 应该会把 jar 和整个 java runtime 解压到临时目录再运行吧? 可能是这个原因
    lisongeee
        5
    lisongeee  
    OP
       Dec 18, 2025
    @yukiww233

    上面那个打包出来的就是一堆文件,启动程序 exe 只有 500kb 大小,就是双击那个文件启动
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2578 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 15:55 · PVG 23:55 · LAX 08:55 · JFK 11:55
    ♥ Do have faith in what you're doing.