-
Notifications
You must be signed in to change notification settings - Fork 31
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
Improve DescriptionPackage.resolveBuildProducts()
performance
#134
Improve DescriptionPackage.resolveBuildProducts()
performance
#134
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This basic concept seems to be fine. However, we're supporting It for Swift 6 snapshot.
These implementations may break when SwiftPM was updated.
Merge this PR before #133, or could you follow its changes after merging that PR?
OK, I will implement Swift 6 support on this branch after #133 is merged. |
I merged #133. Could you fix this PR for Xcode 15.4 and Xcode 16? |
8e28a73
to
999ef2e
Compare
999ef2e
to
1bb3d13
Compare
@giginet OK, I have fixed it. Could you review these changes again? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
implementation is reasonable for me 👍
@Ryu0118 Could you show me the result of this refactoring? How times it speed up?
@freddi-kit I tested the execution of |
Sorry, the current main seems to be broken. I fixed this on #135. Please moment. |
b378923
to
6219b25
Compare
6219b25
to
03a4e7c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great change! It makes sense to use memorization.
I can't wait to measure the impact of our product.
Thank you 😄
Motivation
In my personal application, the package contains a large number of targets, which causes the
resolveBuildProducts()
function to take a significant amount of time to execute. The common libraries added as dependencies to multiple targets lead to redundant generation of the same BuildProducts, resulting in overhead.Proposed Solution
To address this issue, I created a
BuildProductsResolver
class. This class caches the targets passed to thebuildProducts(from:)
function in a visitedTargets property. By doing this, when the same target is encountered again, it returns early, preventing redundant processing. This change significantly reduces execution time by eliminating repeated operations.