Difference Table
Proguard |
R8 |
---|---|
Proguard is having lesser speed in comparison with R8 which affects the build time. | R8 is having a faster processing time which helps developers in reducing build time. |
The output quality by using proguard is not superior. | The output quality using R8 is superior. |
Proguard reduces app size by 8.5 %. | R8 reduces app size by 10 %. |
The conversion process of converting apps code to Optimized Dalvik bytecode is as follows : Apps Code > Java bytecode > Optimized java bytecode > Optimized Dalvik bytecode. |
The conversion process of converting apps code to Optimized Dalvik bytecode is as follows : Apps code > Java bytecode > Optimized Dalvik bytecode. |
Proguard is only supported for the gradle plugin which is below 3.4.0 | R8 is only supported for the gradle plugin of 3.4.0 and above. |
Peephole Optimizations in Proguard is around 520. | Peephole Optimizations in R8 is around 6. |
No of the steps in converting of Apps code to Optimized Dalvik code is 4. | No of the steps in converting Apps code to Optimized Dalvik bytecode is 3. |
Proguard is not having Kotlin specific optimizations. | R8 is having Kotlin specific optimizations. |
Proguard does not propagate constant arguments. | R8 propagate constant arguments. |
Conclusion
While R8 is faster than proguard as there are fewer number steps. It reduces the size of the app in an optimized manner with a default compile-time optimizer.
Difference Between Proguard and R8 in Android
Proguard and R8 both are similar tools that are used for reducing the size of our APK and increase the performance of our APK by shrinking the unused resources. In this article, we will take a look at:
- What is Proguard?
- What is R8?
- Difference between Proguard and R8.