Anyone here tried to benchmark build times after m...
# dagger
a
Anyone here tried to benchmark build times after migrating to Hilt? I tried migrating a project, but the benchmarks show Hilt is significantly slower. I’m going to investigate if there’s just something wrong with my setup; and I’d love to hear your experiences if anyone can share 🙏
c
What exactly is slower?
r
I dont think there is any performance difference with dagger-android vs hilt. It's same object graph, same dagger stuff. Hilt is just an abstraction over dagger-android which does things for you. Less boilerplate.
a
We don’t use dagger-android, just dagger. Just saw this page and it’s probably due to using subcomponents https://dagger.dev/hilt/subcomponents-vs-deps
One of the main advantages of component dependencies is building Dagger code separately and in parallel.
Since Hilt has to aggregate modules, all components would be generated at the same time anyway so we wouldn’t be able to take advantage of building in parallel.
w
You mean it’s slower to compile, not in runtime, right?
a
Ah, yes. sorry the for confusion
👍 2
Triggering an incremental ABI change (add a public method) on a feature module triggers the dexBuilder task and kapt on the app module which weirdly take a long time and take most of the time of the total build duration after migrating to Hilt. I verified incremental kapt is enabled for both modules though.
k
Use incremental annotation processing
a
I verified incremental kapt is enabled for both modules though.
I made sure it is enabled, I verified from kapt.verbose logs