This repository was archived by the owner on Sep 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Parallelize definition, reference, and reference result passes #91
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aidaeology
approved these changes
Aug 18, 2020
Contributor
aidaeology
left a comment
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.
LGTM; very excited about the speed improvements here 🥇
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This makes the traversal of packages for the definition, reference, and reference result passes happen concurrently (up to the number of logical CPUs on the index machine).
The logic changes are mostly in visit.go, which now surrounds the loops with a goroutine that instead feeds a channel for runParallel. The remaining work (the majority of changes) is surrounding access of shared datastructures with appropriate mutexes. This is just a sync.[RW]Mutex in most cases, except for the multi-level
rangesmap, which is guarded by a striped mutex.This implementation is similar to https://github.com/nmvalera/striped-mutex, but does not require hashing the string key to convert it into a stripe index.
Each commit is a logical group, so reviewers may find it easier to review commit-by-commit rather than look at the resulting diff.
Improvement: