KGP 2.3.20 vs 2.3.10

The analysis of the Gradle build performance comparison between two Kotlin variants (2.3.10 and 2.3.20) reveals minor differences in build times and task execution. The overall build time for variant B (Kotlin 2.3.20) is slightly higher by approximately 0.76 seconds (0.76% increase). Configuration times are nearly identical with a negligible difference. Notably, the most time-consuming tasks such as :app:app:mergeExtDexDebug and :app:app:hiltJavaCompileDebug show minimal variation between the two variants. In terms of CPU and memory usage, both variants reach the maximum CPU usage, but variant B uses slightly more memory (0.03 GB more for the build process). The garbage collection metrics indicate a very close number of total collections between the two variants, suggesting similar memory management efficiency.

Kotlin 2.3.10 vs 2.3.0

The analysis of the Gradle build performance data reveals minor but notable differences between the two variants, varianta_2.3.0 and variantb_2.3.10. The overall build time for varianta_2.3.0 is slightly higher with an average of 514.136 seconds compared to 511.726 seconds for variantb_2.3.10, a difference of about 0.47%. Configuration times also show a slight improvement in variantb_2.3.10 with an average time of 46.028 seconds versus 47.689 seconds for varianta_2.3.0, marking a 3.48% decrease. Task execution times across various types and paths show mixed results with minor variations, indicating specific areas where performance tuning affects outcomes. Memory and CPU usage metrics are closely matched between the variants, with no significant differences observed in maximum values.

Kotlin 2.3.0

The analysis of the Gradle build performance data between two variants, varianta_2.2.21 and variantb_2.3.0, reveals subtle differences in build times and task execution. The overall build time for varianta_2.2.21 averaged 569.213 seconds, slightly longer than variantb_2.3.0 at 567.616 seconds, a marginal improvement of about 0.28%. Configuration times also saw a decrease from 54.823 seconds in varianta_2.2.21 to 52.565 seconds in variantb_2.3.0, improving by approximately 4.12%. Notably, the most time-consuming tasks across both variants include :core:account:kspDebugKotlin, :core:analytics:kspDebugKotlin, and :core:alarm:compileDebugKotlin, with minor variations in execution times between the variants. The garbage collection metrics indicate a slight increase in total collections for variantb_2.3.0, suggesting a minor increase in memory management activities.

Terminating Kotlin Process before R8 Task execution

The analysis of the Gradle build performance data reveals that variant B (kill_process_before_r8) generally performs better than variant A (r8). Specifically, the overall build time for variant B is shorter by approximately 8.3 seconds (1.7% improvement). This trend is consistent across various task types, where variant B often shows reduced execution times. Notably, the R8Task, one of the most time-consuming tasks, executes about 4.4 seconds faster in variant B. Memory usage is also slightly lower in variant B across all processes, with a maximum reduction of about 1.55 GB in overall system memory usage. CPU usage remains high and nearly maxed out for both variants, indicating a CPU-bound process.

Kotlin 2.3.0-beta2

The analysis of the Gradle build performance data reveals minor differences between the two variants, varianta_2.2.20 and variantb_2.3.0-beta2. The overall build time is slightly reduced in variantb_2.3.0-beta2 by approximately 0.15% (from 580.709 seconds to 579.848 seconds). Configuration times are nearly identical with a negligible decrease in the newer variant. The most time-consuming tasks across both variants include Kotlin compilation and various Android build tasks, with minor variations in execution times between the two variants. Memory usage and CPU utilization for both the build process and child processes are comparable, with no significant differences observed. The total number of garbage collection operations remains consistent across variants.

KGP 2.2.10 vs 2.2.20

The analysis of the Gradle build performance between variants 2.2.10 and 2.2.20 reveals subtle differences in build times and task execution. The overall build time for variant 2.2.20 is slightly higher by about 3.3 seconds (0.92% increase) compared to variant 2.2.10. The configuration time also shows a minor increase of 0.63 seconds (1.46% increase) in variant 2.2.20. Notably, the most time-consuming tasks across both variants include :app:app:hiltJavaCompileDebug, :app:app:mergeExtDexDebug, and :core:cart:compileDebugKotlin, with variant 2.2.20 generally showing a marginal increase in execution times. Memory usage is slightly lower in variant 2.2.20 by about 0.21 GB (2.01% decrease), while CPU usage remains maximized at 100% for both variants. The total garbage collection counts are very close, with variant 2.2.20 having just one more collection than 2.2.10.

KSP 2.2.10 with KSP2 Enabled

The analysis of the Gradle build performance data reveals that Variant B (variantb_2.2.10-ksp2) generally has longer build times compared to Variant A (varianta_2.2.10). Specifically, the mean build time for Variant B is approximately 8.2% longer than Variant A, translating to an increase of about 30.3 seconds. This trend is consistent across the P50 and P90 percentiles as well. In task execution, Variant B shows longer times particularly in Kotlin-related tasks, suggesting a possible area for optimization. Memory usage is also higher in Variant B by approximately 15.3%, which could be contributing to the increased build times. The total garbage collection (GC) events are significantly higher in Variant B, indicating more frequent memory management operations which could be impacting performance.

KGP 2.2.10 vs 2.2.0

The analysis of the Gradle build performance data reveals minor differences between the two variants, varianta_2.2.0 and variantb_2.2.10. The overall build time for varianta_2.2.0 averages around 372.6 seconds, while variantb_2.2.10 is slightly faster at 370.4 seconds, marking a modest improvement of approximately 0.6%. The most time-consuming tasks across both variants include :core:identity:compileDebugKotlin, :core:contact:compileDebugKotlin, and :feature:post:compileDebugKotlin, with each showing minor time differences between the variants. Memory usage is slightly higher in variantb_2.2.10 with a peak of 10.94 GB compared to 10.74 GB in varianta_2.2.0. CPU usage for both variants reached the maximum capacity of 100%. The Kotlin build reports indicate a slight efficiency improvement in variantb_2.2.10 in terms of incremental compilation and compiler code generation.

KGP 2.2.20-Beta2 vs 2.2.0

The analysis of the Gradle build performance comparison between varianta_2.2.0 and variantb_2.2.20-Beta2 reveals several key findings. The overall build time for variantb_2.2.20-Beta2 is slightly longer, with a mean time of 762.133 seconds compared to 750.638 seconds for varianta_2.2.0, marking a 1.53% increase. Significant differences are noted in task execution times, particularly for :core:account:kspDebugKotlin which shows a 44% increase in mean execution time in variantb_2.2.20-Beta2. The CPU and memory usage are closely matched between the variants, with both maxing out CPU usage at 100% and memory usage peaking around 14 GB. The Kotlin Build Reports indicate that variantb_2.2.20-Beta2 has a slightly longer compiler code analysis time but a quicker code generation rate.

Increasing Gradle process memory in KSP2 scenario

The analysis of the Gradle build performance data reveals several key insights between the two variants, varianta_k2_kotlin_2.2.0 and variantb_k2_increase_memory_gradle. The overall build time for variantb_k2_increase_memory_gradle is slightly higher at approximately 626.643 seconds compared to 618.083 seconds for varianta_k2_kotlin_2.2.0, marking a 1.38% increase. Among the most time-consuming tasks, significant differences are observed in tasks like com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask and dagger.hilt.android.plugin.task.AggregateDepsTask, where variantb_k2_increase_memory_gradle shows increased execution times. Memory usage also shows a notable increase in variantb_k2_increase_memory_gradle with a maximum of 13.57 GB compared to 11.65 GB in varianta_k2_kotlin_2.2.0. The total garbage collection (GC) counts are slightly lower in variantb_k2_increase_memory_gradle across both Gradle and Kotlin processes.

K2 with Kotlin 2.1.21

The performance comparison between two Gradle build variants shows notable differences in build times and resource usage. Variant B generally exhibits longer build times with a mean build time of 617.338 seconds compared to Variant A’s 569.857 seconds, marking an 8.3% increase. The most time-consuming tasks in Variant B are consistently longer than in Variant A, particularly :layer_0:module_0_1:kspDebugKotlin which takes 14.614 seconds in Variant B versus 10.220 seconds in Variant A. Memory usage is also higher in Variant B with a maximum of 11.73 GB compared to 11.45 GB in Variant A. CPU usage for the build process is slightly higher in Variant B at 96.98% compared to 96.32% in Variant A. Garbage collection activities are more frequent in Variant B with 280 total collections compared to 204 in Variant A, indicating potential inefficiencies in memory management.

K2 with Kotlin 2.2

The analysis of Gradle build performance data reveals several key differences between varianta_kotlin_2.2.0 and variantb_k2_kotlin_2.2.0. Notably, the overall build time for variant B is longer by approximately 42.7 seconds (7.3% increase). In task execution, the :layer_0:module_0_10:kspDebugKotlin task shows a significant increase in execution time in variant B, suggesting a potential area for optimization. Memory usage is higher in variant B across all processes, with a notable increase in the main build process (up to 6.7 GB in variant B compared to 5.1 GB in variant A). Garbage collection activities also increased in variant B, indicating heavier memory management activities. These findings suggest that variant B may be less efficient in terms of both time and resource usage compared to variant A.

Kotlin 2.2.0 vs 2.1.21, Android 230 modules

The analysis of the Gradle build performance data reveals subtle yet insightful differences between two Kotlin variants, varianta_kotlin_2.1.21 and variantb_kotlin_2.2.0. The overall build time shows a slight improvement in variantb by approximately 0.42 seconds (0.4% faster). Notably, the most time-consuming tasks across variants include :layer_0:module_0_1:kspDebugKotlin, :layer_0:module_0_10:kspDebugKotlin, and :layer_0:module_0_12:kspDebugKotlin, with variantb generally showing marginal increases in execution times. CPU and memory usage are closely matched between the variants, with variantb showing a slight increase in maximum memory usage by about 0.09 GB. Garbage collection metrics indicate a very similar performance, with total collections slightly lower in variantb. The Kotlin Build Reports highlight a faster compiler code generation and analysis in variantb, suggesting efficiency improvements in the newer Kotlin version.

Kotlin 2.1.20 vs 2.1.0 in nowinandroid

The Gradle build performance comparison shows a slight improvement in overall build times for variantb_kotlin_2_1_20 compared to varianta_main_2_1_0, with a mean time of 213.747 seconds versus 214.317 seconds, respectively. The most time-consuming tasks across both variants were ‘org.jetbrains.kotlin.gradle.tasks.KotlinCompile’, ‘com.android.build.gradle.internal.tasks.DexMergingTask’, and ‘com.android.build.gradle.tasks.PackageApplication’. Notably, the ‘com.google.devtools.ksp.gradle.KspTaskJvm’ task showed a significant timing variation of more than 10% between the two variants. In terms of resource consumption, both variants showed similar CPU and memory usage, with a slight increase in memory usage for variantb_kotlin_2_1_20.

Reducing parallelization of Kotlin compiler to 3 workers in nowinandroid

The Gradle build performance comparison shows that the build times between the two variants are almost identical with a mean difference of just 99ms (0.05%). The variant with the Kotlin compiler and 3 workers (variantb_kotlin_compiler_3_workers) has slightly higher P90 values in most tasks, indicating that it might be slower in worst-case scenarios. The most time-consuming tasks across both variants are :app:l8DexDesugarLibDemoDebug, :app:mergeExtDexDemoDebug, and :core:designsystem:compileDemoDebugKotlin. Notably, the :app:mergeExtDexDemoDebug task is faster in variantb_kotlin_compiler_3_workers by 10.3%. CPU and memory usage are almost identical between the two variants.