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: parallelism to speed up conflict search #171

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

letFunny
Copy link
Collaborator

@letFunny letFunny commented Nov 7, 2024

  • Have you signed the CLA?

Right now all commands (info, find and cut) validate the release as a whole. For big releases such as ubuntu 24.04 this takes up the majority of the execution time. When looking at perf data it clearly shows that the bottleneck is strdist.GlobPath. In the past we already reduced the number of comparisons to a minimum and I have tried to optimize the code but nothing moves the needle. Because this task is CPU bounded and there are no low hanging fruits, the best approach is to parallelize the computation to all available CPUs.

In my computer with 4 logical CPUs, this change halves the total execution time for both the commands and the tests.

@letFunny letFunny added the Polish Refactorings, etc label Nov 7, 2024
@@ -197,34 +199,60 @@ func (r *Release) validate() error {
}
}

// Check for glob and generate conflicts.
// Check for generate and glob conflicts.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

[Comment for reviewer]: This is based on a nitpick by Ed about reading generate as a verb instead of a noun.

@@ -917,3 +945,22 @@ func packageToYAML(p *Package) (*yamlPackage, error) {
}
return pkg, nil
}

type Semaphore struct {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

[Comment for reviewer]: This type mostly exists for documentation because the pattern of using a channel as a semaphore can be difficult to understand when reading the code if you have not seen it before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Polish Refactorings, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant