Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@asodja
Copy link

@asodja asodja commented May 5, 2024

This change should improve build time a bit when quarkusGenerateAppModel tasks are UP-TO-DATE for no configuration cache case.

We try to avoid resolving quarkus classpaths by having only original classpaths as an input from which quarkus classpaths are calculated instead of quarkus classpaths themself.

In a build scan I still see that some quarkus configurations are resolved during configuration if quarkusGenerateAppModel is UP-TO-DATE, but these are pretty fast:
Screenshot 2024-05-05 at 21 09 22

Compared to the version before where it was:
Screenshot 2024-05-05 at 21 16 05

* and we don't want to do that if task is up-to-date
*/
@Classpath
public abstract ConfigurableFileCollection getOriginalClasspath();
Copy link
Author

@asodja asodja May 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💭 This is the main change, we add getOriginalClasspath as an input that tracks original classpath instead of tracking Quarkus classpath as input


private static String resolveClassifier(ModuleVersionIdentifier moduleVersionIdentifier, File file) {
String moduleGroupName = moduleVersionIdentifier.getVersion().isEmpty()
String artifactIdVersion = moduleVersionIdentifier.getVersion().isEmpty()
Copy link
Author

@asodja asodja May 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💭 Changes to this method are kinda unrelated, I just noticed there was a bug in resolving classifier

}

private static Configuration[] getOriginalRuntimeClasspaths(Project project, LaunchMode mode) {
List<String> configurationNames = switch (mode) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💭 These are original classpaths for every mode

*/
@Internal
public abstract Property<ResolvedComponentResult> getRoot();
public abstract Property<ArtifactCollection> getResolvedArtifactCollection();
Copy link
Author

@asodja asodja May 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💭 I also changed QuarkusResolvedClasspath a bit so it uses ArtifactCollection now

@asodja asodja force-pushed the proposal_using_tasks_serializing_appmodel branch from 17fcd30 to 68513c5 Compare May 6, 2024 03:31
@cdsap
Copy link
Owner

cdsap commented May 7, 2024

Hi @asodja, thank you very much!
I tested locally your changes and I got the same results, awesome job. I'm going to add a new variant in the performance experiment to include the results with the expectation of reducing the configuration time increase that we observed when comparing the proposal against main.

@cdsap
Copy link
Owner

cdsap commented May 8, 2024

Results performance test with this approach(proposal 2):
Project rh-subscriptions
Clean build (100 iterations)
chart (24)

Incremental build (20 iterations)
chart (25)

Project nessie
Clean build (100 iterations)
chart (26)

Incremental build (20 iterations)
chart (27)

Notes:

  • With this approach we reduce the increase of the configuration time, great job
  • Execution time increases on incremental cacheable builds because we are invalidating the Quarkus task inputs of the serailized model.

@asodja
Copy link
Author

asodja commented May 9, 2024

What are the changes for incremental done in the incremental build? I wonder why model gets invalidated.

I think we could improve some things, e.g. Quarkus model depends just on the resources files, so for local project dependencies we could request just LibraryElements.RESOURCES and have that as an input.

But maybe that is an idea that could be implemented by Quarkus developers or some contributor. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants