You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Probably related to #429, but the issue is so significant that I would consider this a bug. I understand the premise that kotlin-inject is not aiming for the same build and runtime performance as Dagger.
We migrated our middle-sized project from Dagger 2 to kotlin-inject. Our component size grew from 2,566 lines of Java code to 13,430 lines of Kotlin code. This single file slows down kotlinc significantly and voids the gains of removing KAPT from the project at build time.
Further, there is a lot of duplication that also has an impact at runtime. Provider methods get nested deeply, which causes patterns in the file like this:
I left out some details, in total it's 21 lines. These 21 lines are generated 93 times in the component, which makes it close to 2,100 lines of code, which could be reduced to 21 + 93. That is significant. In another example a block is 55 lines and duplicated 34 times.
This adds a lot of overhead at build time, slows the IDE down and is extra overhead at runtime, because all this code needs to be loaded. I'm afraid it will get worse over time when our object graph evolves as small changes to a single provider method could add thousands of lines of generated code.
The text was updated successfully, but these errors were encountered:
Probably related to #429, but the issue is so significant that I would consider this a bug. I understand the premise that kotlin-inject is not aiming for the same build and runtime performance as Dagger.
We migrated our middle-sized project from Dagger 2 to kotlin-inject. Our component size grew from 2,566 lines of Java code to 13,430 lines of Kotlin code. This single file slows down kotlinc significantly and voids the gains of removing KAPT from the project at build time.
Further, there is a lot of duplication that also has an impact at runtime. Provider methods get nested deeply, which causes patterns in the file like this:
We have a provider function like this:
When called in-place in the generated component, the code looks like this:
I left out some details, in total it's 21 lines. These 21 lines are generated 93 times in the component, which makes it close to 2,100 lines of code, which could be reduced to 21 + 93. That is significant. In another example a block is 55 lines and duplicated 34 times.
This adds a lot of overhead at build time, slows the IDE down and is extra overhead at runtime, because all this code needs to be loaded. I'm afraid it will get worse over time when our object graph evolves as small changes to a single provider method could add thousands of lines of generated code.
The text was updated successfully, but these errors were encountered: