Martin
09/18/2025, 10:48 AMBuildService ? I'm guessing nothing prevents it? But I'm not sure I've seen this pattern before so I thought I'd askMartin
09/18/2025, 10:49 AMMartin
09/18/2025, 10:50 AMVampire
09/18/2025, 10:55 AMConfigurableFileCollection in the build service to which you add the configuration?
🤷♂️Martin
09/18/2025, 10:56 AMConfiguration objects created, I had a discussion not so long ago where people mentioned Configuration was quite expensiveMartin
09/18/2025, 10:57 AMFileCollection already, I could just skip creating the configuration 🤔Martin
09/18/2025, 10:57 AMMartin
09/18/2025, 10:58 AMproject references are long gone...Martin
09/18/2025, 10:58 AMVampire
09/18/2025, 11:10 AMConfiguration actually is a FileCollection also.
If you for example try to have a Configuration property in a task, configuration cache will complain as Configuration is not supported.
But by simply having an explicit type of the property to be FileCollection, the configuration cache treats the Configuration as FileCollection and properly handles it.
With configuration cache, the dependency resolution is anyway done latest at the time the CC entry is written and not actually at execution time. In the CC entry there is then only the result of the resolution and it requires the files in the Gradle cache to be present.Martin
09/18/2025, 12:02 PMmeasureTime {
repeat(1_000_000) {
configurations.create("test$it")
}
}.let {
println("took $it")
}
It takes ~2s to create 1M configurations on my MacBook and uses ~3GB of heap
So probably the memory is the issue thereMartin
09/18/2025, 12:02 PMMartin
09/18/2025, 12:03 PMVampire
09/18/2025, 12:03 PMMartin
09/18/2025, 12:04 PMVampire
09/18/2025, 12:05 PMMartin
09/18/2025, 12:05 PMresolvable vs consumable configurations so that each one would use less memory but that effort isn't completely over the finish line yet