trycatchx / RocketX

🔥🔥 android 端编译加速插件🚀 动态识别未改动 module 并在编译流程中替换为 aar ,只编译改动模块,加速 Android apk 的编译速度。
861 stars 104 forks source link

在gradle7.0上面感觉运行速度还是很慢 #17

Closed lhjgege closed 2 years ago

lhjgege commented 2 years ago

我升级了我的项目到gralde7.0.3版本后每次运行起码的3分钟以上。在4.1.3版本的时候就很快,不知道是不是没有适配7.0的原因

trycatchx commented 2 years ago

1、检查 根目录/.gradle/.rockectx/.app/ 文件夹缓存是否生成。 2、并查看 执行的task 是否只有 app module 和 改动的module (其他module 的task 理论是不允许执行) 3、以上两点都正常请贴一下:耗时图 image 4、第一次是全量无增速效果,请查看2 次以上修改code 的编译速度

lhjgege commented 2 years ago

我换一个手机点击安装的就会很慢

lhjgege commented 2 years ago

换一个手机点击安装感觉像是重新全量编译。

trycatchx commented 2 years ago

@lhj1079947827 换个手机 你可以用 assembledebug task 试试。 (直接点击 run ,as 对这方面有一定的处理)

trycatchx commented 2 years ago

你可以测试一下点击 run 在同一个手机的速度 是否有提升呢?

lhjgege commented 2 years ago

同一个手机有提升的。

lhjgege commented 2 years ago

但是不同手机点击安装没有提升每次都是全量编译的感觉。因为我这里有多个手机所以会安装很多手机。如果每个手机都是全量编译那么感觉速度还是没提升的感觉。同一个手机我刚才测试了提升很大从3分钟提升到25S

trycatchx commented 2 years ago

image 可以通过尝试使用 assembledebug task 运行(这个和换手机关系就不大了,应该可以满足你的需要)

lhjgege commented 2 years ago

image 我这里没这个选项

lhjgege commented 2 years ago

image 就修改两个类感觉时间忽快忽慢

lhjgege commented 2 years ago

image 上面图就是compileDebugKotlin和transformClassesWithASMPPluginForDebug两个插件耗时

trycatchx commented 2 years ago

@lhj1079947827 transformClassesWithASMPPluginForDebug 这个插件关闭是否会有影响:可以通过:

//app moudle 下的 build.gradle
android {
    //...
    //配置插件编译项
    RocketX {
        openLog = true
        //加速模式 禁用可禁用的 transform ,速度更快
        transFormList = ["ASMPPlugin"]
    }
}

插件的名字你需要确认一下是不是 :ASMPPluginForDebug,通过在build log 查找关键字: transFormList ,会有提示。

trycatchx commented 2 years ago

@lhj1079947827 禁用之后 buildDex,以及 mergeDex 会更快。应该可以跑进10s内

lhjgege commented 2 years ago

你是禁用那个插件,是上面两个插件吗

trycatchx commented 2 years ago

禁用ASMPPlugin

trycatchx commented 2 years ago

@lhj1079947827 请问有效果吗?