Does anyone know why, when I rerun (100% up-to-dat...
# community-support
v
Does anyone know why, when I rerun (100% up-to-date cache hits) an assemble task via cli, I get "BUILD SUCCESSFUL in 1s" and when I run the same command via intellij run config "BUILD SUCCESSFUL in 4s"? i.e. way slower for same operation - what is the IDE doing extra? Is it maybe the console output writing? Thats the only difference I see (default vs --console=plain)
v
Run both with build
--scan
if you can and compare where the time is spent. If you cannot, maybe instead check with the
gradle-profiler
.
j
Yeah scan/profile is the way, but I have a guess: intellij injects an init script into the build. I think long term this should be replaced by tooling API calls, but maybe there is info they need that is not exposed via that API?
v
It's almost always both. You use the unit script to inject logic like attaching the IJ coverage agent to tests, or creating tasks to run applications, or configure configurations to retrieve sources, or to build additional tooling API models that you can then request via the tooling API, ..... All the things you can not do via tooling API calls. But it should usually not. Multiply configuration time by 4. Maybe building the models IJ requests needs that long, especially if IP is not enabled. But without investigating this is all just guesswork. šŸ¤·ā€ā™‚ļø
a
> what is the IDE doing extra? • Fetching models from Gradle (which isn't parallelised yet see https://youtrack.jetbrains.com/issue/KTIJ-28043/Support-parallel-model-loading and https://youtrack.jetbrains.com/issue/KT-89571) • Generated Groovy init scripts need to be compiled (binary plugins would be faster). I saw lots of activity recently, so it's being worked on.
šŸ‘Œ 2
v
@Adam btw the 2 links are the same
fixed 1
a
If it's just an assemble task IntelliJ won't fetch models. I would guess you get a) cold daemon b) cc miss if you use configuration-cache But that is again a guess