https://kotlinlang.org logo
Title
p

Paul Woitaschek

11/14/2018, 9:32 AM
Oh I hate Gradle. They told us modularizing would speed up the build. Now my Gradle sync takes 2 minutes each time 😿
a

artem_zin

11/14/2018, 9:33 AM
lol, welcome to the club the thing is, Gradle never told that, those were people in the community
h

hallvard

11/14/2018, 9:35 AM
I take it you do not come to gradle from sbt?
😂 1
g

gildor

11/14/2018, 9:36 AM
Just curious, how many modules do you have?
m

madisp

11/14/2018, 9:53 AM
Gradle sync with 100+ modules should still be like a few seconds at most?
🤣 1
a

artem_zin

11/14/2018, 10:00 AM
really depends, configuration phase is very problematic - it’s not cached - it’s serial (anything that blocks it, like file i/o blocks the entire thing)
for us it’s 20-60 seconds on macbooks (2018 i9 to 2016 i7), we don’t do file io and in general maintain our build.gradles in good shape
d

dsvoronin

11/14/2018, 10:04 AM
while configuration phase is kinda fast for us (~200 modules, ~20 inhouse plugins affecting configuration phase, android project) and about 10-30 sec on warmed up daemon AS sync on other side could be 1-2 min easily (library modules with ignored debug type, skip sources generation in IDE)
g

gildor

11/14/2018, 10:06 AM
10-30 sec only for configuration?
d

dsvoronin

11/14/2018, 10:07 AM
yep, kotlin android extension still forces deps resolution in config time
g

gildor

11/14/2018, 10:07 AM
Yeah, this is a big problem
d

dsvoronin

11/14/2018, 10:07 AM
and i think we know 1-2 more places for improvements, that specific to our shit coded scripts
+ kts problems
g

gildor

11/14/2018, 10:09 AM
Problem with android extensions should be fixed in 1.3.20
d

dsvoronin

11/14/2018, 10:11 AM
yep, subscribed to half of jb youtrack 😄
maybe we should create somthing like community driven “known issues” repo, with this secret knowledge about current gradle issues?
o

orangy

11/14/2018, 10:15 AM
Why a different repo? It’s OSS, you can send PRs right to the docs!
g

gildor

11/14/2018, 10:15 AM
Isn’t issue tracker is not enough?
d

dsvoronin

11/14/2018, 10:16 AM
it’s not about issues only, but also for workarounds and hints
g

gildor

11/14/2018, 10:16 AM
Problem that workarounds are not available often
like in case of android extension issue
d

dsvoronin

11/14/2018, 10:17 AM
i don’t know what the right place for “don’t upgrade to 4.10 gradle if you have android project and use kts”
yep, extensions will be like: expect some performance impact if you use it, around Xs. until KT-XXX will be fixed
but you should upgrade to 1.3.20 then, and it forces you to upgrade gradle to 5.0x if you use kts, because it has some connection, but you couldnt if you on android, until agp support 5.0 gradle
you could though, but kts in buildsrc and kotlin version in project has some hardly debuggable effects on each other, and there should be workarounds
@artem_zin we need that emoji (open eyed laugh crying) here
1
g

gildor

11/14/2018, 10:22 AM
Isn’t it problem of any pre-release software?
especially combination of multiple pre-release software
d

dsvoronin

11/14/2018, 10:23 AM
it is stable now afaik )
g

gildor

11/14/2018, 10:23 AM
4.10 yes, but not Kotlin DSL
d

dsvoronin

11/14/2018, 10:23 AM
kotlin dsl is stable !
g

gildor

11/14/2018, 10:23 AM
and afaik 4.x is not supported anymore
d

dsvoronin

11/14/2018, 10:24 AM
https://github.com/gradle/kotlin-dsl/releases/tag/v1.0.2 but it’s part of unstable 5.0 gradle
g

gildor

11/14/2018, 10:24 AM
Yes, and not available without Gradle 5.0
🤕 1
which is not released
But another problem that Android Gradle Plugin is highly coupled with Gradle
d

dsvoronin

11/14/2018, 10:26 AM
ok, this particular problem sure is a my own headache
g

gildor

11/14/2018, 10:26 AM
I mean, I feel your pain, had such cases myself, just better to expect it if you want to be on cutting edge 🙈
p

Paul Woitaschek

11/14/2018, 11:08 AM
Problem with android extensions should be fixed in 1.3.20
Do you have a youtrack link?
a

Andrey Uskov [JB]

11/14/2018, 11:13 AM
@Paul Woitaschek, could you please provide a steps to reproduce your issue? I'll try to take a look. BTW we have improved import process (KT-27832). The speedup is up to several times depending on project structure.
👍 1
d

dsvoronin

11/14/2018, 11:15 AM
@Andrey Uskov [JB] is there a target version for the fix? youtrack doesn’t have one
a

Andrey Uskov [JB]

11/14/2018, 11:22 AM
@gildor, I'd like to see ab initio problem in order to make sure that KT-26065 is the only reason of slow import in the case.
g

gildor

11/14/2018, 11:23 AM
What is "import" in terms of Gradle?
This is issue that cause visible overhead on each build because happening on configuration time, so adds overhead to every Gradle invocation
a

Andrey Uskov [JB]

11/14/2018, 11:25 AM
@dsvoronin, it should be available in 1.3.20
🎉 1
g

gildor

11/14/2018, 11:25 AM
You can check how many time of your configuration time you can save if you check your build scan dependency resolution time
It should be 0 for warm daemon without dendency changes
a

Andrey Uskov [JB]

11/14/2018, 11:35 AM
@gildor, as far as I understand, this issue is not the only reason of slow sync process in Idea/AS. For example some slowdown was observed due to IDEA-200434 - impact on configuration phase, KT-26065 - overhead in Idea during dependency resolution. May be in the case we have any other issue.
BTW the issue IDEA-200434 may affect performance of configuration phase because if you have a new gradle.init the configuration phase works longer. Upd.: I've tested the case with Robot-Scouter, it looks like the fix of IDEA-200434 matters (sync duration: 32s at my PC before fix and 16s after fix).
g

gildor

11/16/2018, 11:59 AM
this issue is not the only reason of slow sync process in Idea/AS
@Andrey Uskov [JB] Of course, and I never tell that. This issue not about sync in general, but about “configuration phase” of gradle, which affects all gradle invocations and every build, not only sync. Sync of project is completely different story