Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(maven): improve PreFetch for Maven #1485

Merged
merged 6 commits into from
Jan 13, 2025
Merged

feat(maven): improve PreFetch for Maven #1485

merged 6 commits into from
Jan 13, 2025

Conversation

cuixq
Copy link
Contributor

@cuixq cuixq commented Jan 10, 2025

We disabled PreFetch in #1466 and this caused the resolution performance worse for deps.dev client.

To enable PreFetch, we need to avoid unnecessary requests of maven-metadata.xml files which is a result of calling MatchingVersions and Versions.

This PR improves the logic in PreFetch so that MatchingVersions is only called for non-soft Maven requirements and Versions is called for ecosystems other than Maven.

It used to take about 1m to resove pom.xml without PreFetch enabled and now it takes less than 20 seconds.

@codecov-commenter
Copy link

codecov-commenter commented Jan 10, 2025

Codecov Report

Attention: Patch coverage is 84.61538% with 4 lines in your changes missing coverage. Please review.

Project coverage is 66.94%. Comparing base (7acec29) to head (c594fbb).

Files with missing lines Patch % Lines
internal/resolution/client/client.go 84.00% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1485      +/-   ##
==========================================
+ Coverage   66.84%   66.94%   +0.09%     
==========================================
  Files         198      198              
  Lines       18650    18660      +10     
==========================================
+ Hits        12467    12492      +25     
+ Misses       5498     5486      -12     
+ Partials      685      682       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cuixq cuixq marked this pull request as ready for review January 12, 2025 23:53
@cuixq cuixq requested a review from michaelkedar January 13, 2025 00:03
Copy link
Member

@michaelkedar michaelkedar left a comment

Choose a reason for hiding this comment

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

Nice

internal/resolution/client/client.go Outdated Show resolved Hide resolved
@cuixq cuixq merged commit 4077a22 into google:main Jan 13, 2025
13 checks passed
@cuixq cuixq deleted the prefetch branch January 13, 2025 00:40
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.

3 participants